3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function error_handler($errno, $errstr, $errfile, $errline) { $a = func_get_args(); var_dump($a); } set_error_handler("error_handler"); try { $x = new NonexistantClass(); } catch (Exception $e) { var_dump($e->getMessage()); } echo "Don't worry, everything is still fine!\n";
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Class 'NonexistantClass' not found in /in/nsrfH:11 Stack trace: #0 {main} thrown in /in/nsrfH on line 11
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Class undefined: NonexistantClass in /in/nsrfH on line 11 array(6) { [0]=> int(16777217) [1]=> string(33) "Class undefined: NonexistantClass" [2]=> string(9) "/in/nsrfH" [3]=> int(11) [4]=> array(0) { } [5]=> array(1) { [0]=> array(2) { ["file"]=> string(9) "/in/nsrfH" ["line"]=> int(11) } } }
Output for 5.0.0 - 5.6.28
Fatal error: Class 'NonexistantClass' not found in /in/nsrfH on line 11
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/nsrfH on line 10
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/nsrfH on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/nsrfH on line 10
Process exited with code 255.