3v4l.org

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