3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function exception_error_handler($errno, $errstr, $errfile, $errline ) { throw new Exception('Hello world'); } set_error_handler("exception_error_handler"); try { // try loading a file that does not have exif data: $results = require 'does-not-exist.php'; } catch (Exception $e) { echo $e->getMessage(); // "We never get here..." };
based on 044b4
Output for 7.1.20 - 7.2.6
Warning: Uncaught Exception: Hello world in /in/U9bu8:4 Stack trace: #0 /in/U9bu8(10): exception_error_handler(2, 'require(): open...', '/in/U9bu8', 10, Array) #1 /in/U9bu8(10): require() #2 {main} thrown in /in/U9bu8 on line 4 Fatal error: main(): Failed opening required 'does-not-exist.php' (include_path='.:') in /in/U9bu8 on line 10
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Warning: Uncaught Exception: Hello world in /in/U9bu8:4 Stack trace: #0 /in/U9bu8(10): exception_error_handler(2, 'require(does-no...', '/in/U9bu8', 10, Array) #1 /in/U9bu8(10): require() #2 {main} thrown in /in/U9bu8 on line 4 Fatal error: main(): Failed opening required 'does-not-exist.php' (include_path='.:') in /in/U9bu8 on line 10
Process exited with code 255.
Output for 5.3.18 - 5.3.29, 5.4.8 - 5.6.28
Warning: Uncaught exception 'Exception' with message 'Hello world' in /in/U9bu8:4 Stack trace: #0 /in/U9bu8(10): exception_error_handler(2, 'require(does-no...', '/in/U9bu8', 10, Array) #1 /in/U9bu8(10): require() #2 {main} thrown in /in/U9bu8 on line 4 Fatal error: main(): Failed opening required 'does-not-exist.php' (include_path='.:') in /in/U9bu8 on line 10
Process exited with code 255.
Output for 5.3.3 - 5.3.17, 5.4.0 - 5.4.7
Fatal error: main(): Failed opening required 'does-not-exist.php' (include_path='.:') in /in/U9bu8 on line 10
Process exited with code 255.
Output for 5.3.0 - 5.3.2
Fatal error: main(): Failed opening required 'does-not-exist.php' (include_path='.:') in /in/U9bu8 on line 0
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Fatal error: main(): Failed opening required 'does-not-exist.php' (include_path='.:') in /in/U9bu8 on line 13
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/U9bu8 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_NEW in /in/U9bu8 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/U9bu8 on line 4
Process exited with code 255.