3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function exception_error_handler($severity, $message, $file, $line) { if (!(error_reporting() & $severity)) { // This error code is not included in error_reporting return; } throw new ErrorException($message, 0, $severity, $file, $line); } set_error_handler("exception_error_handler"); try { require_once 'nosuchfile.php'; } Catch (ErrorException $e) { var_dump($e); }
Output for 7.0.0 - 7.2.0
Warning: Uncaught ErrorException: require_once(nosuchfile.php): failed to open stream: No such file or directory in /in/Mfj5e:12 Stack trace: #0 /in/Mfj5e(12): exception_error_handler(2, 'require_once(no...', '/in/Mfj5e', 12, Array) #1 /in/Mfj5e(12): require_once() #2 {main} thrown in /in/Mfj5e on line 12 Fatal error: main(): Failed opening required 'nosuchfile.php' (include_path='.:') in /in/Mfj5e on line 12
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Warning: Uncaught exception 'ErrorException' with message 'require_once(nosuchfile.php): failed to open stream: No such file or directory' in /in/Mfj5e:12 Stack trace: #0 /in/Mfj5e(12): exception_error_handler(2, 'require_once(no...', '/in/Mfj5e', 12, Array) #1 /in/Mfj5e(12): require_once() #2 {main} thrown in /in/Mfj5e on line 12 Fatal error: main(): Failed opening required 'nosuchfile.php' (include_path='.:') in /in/Mfj5e on line 12
Process exited with code 255.