3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function myErrorHandler($errno, $errstr, $errfile, $errline) { echo "I regret nothing, except ".$errstr."\n"; /* Don't execute PHP internal error handler */ return true; } $old_error_handler = set_error_handler("myErrorHandler"); echo "start\n"; try { trigger_error("I R ERROR\n", E_USER_ERROR); } catch (Exception $e) { echo "Caught exception\n"; } echo "end\n";
Output for 5.0.0 - 7.1.0
start I regret nothing, except I R ERROR end
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/STUvu on line 17
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/STUvu on line 17
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/STUvu on line 17
Process exited with code 255.