3v4l.org

run code in 200+ 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()); } catch (Error $e) { var_dump($e); } echo "Don't worry, everything is still fine!\n";
based on nsrfH
Output for 7.0.0 - 7.2.0
object(Error)#1 (7) { ["message":protected]=> string(34) "Class 'NonexistantClass' not found" ["string":"Error":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/SJpJi" ["line":protected]=> int(11) ["trace":"Error":private]=> array(0) { } ["previous":"Error":private]=> NULL } Don't worry, everything is still fine!
Output for 5.3.20 - 5.6.28
Fatal error: Class 'NonexistantClass' not found in /in/SJpJi on line 11
Process exited with code 255.