fork download
  1. <?php
  2. $a = 0;
  3. var_dump($a++ + ($a += 2));
  4. echo "------------\n";
  5. $a = 0;
  6. var_dump($a++ + $a += 2);
  7. echo "------------\n";
  8. $a = 0;
  9. $b = $a++;
  10. $c = $a += 2;
  11. var_dump($a, $b, $c, $b + $c);
  12. echo "------------\n";
  13. $a = 0;
  14. $c = $a += 2;
  15. $b = $a++;
  16. var_dump($a, $b, $c, $b + $c);
  17.  
  18. //https://pt.stackoverflow.com/q/226847/101
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
int(3)
------------
int(3)
------------
int(3)
int(0)
int(3)
int(3)
------------
int(3)
int(2)
int(2)
int(4)