3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function f() { global $x; echo "f() before: $x\n"; $x = $x + 10; echo "f() after: $x\n"; return 1; } $x = 0; echo "file before: $x\n"; $y = $x + f(); $x = $y; echo "file after: $x\n";
based on vUMSq
Output for 5.1.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
file before: 0 f() before: 0 f() after: 10 file after: 11
Output for 4.3.0 - 5.0.5
file before: 0 f() before: 0 f() after: 10 file after: 1