3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $f = function(){ static $run = 0; if ($run) { throw new Exception("I've already been run!"); } $run = 1; echo "I'm running\n"; } $f(); $f();
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected '$f' (T_VARIABLE) in /in/bXDRs on line 13
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/bXDRs on line 13
Process exited with code 255.