3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function exceptionTest() { try { throw new TestException(); } catch (TestException $e) { echo "Caught TestException ('{$e->getMessage()}')\n{$e}\n"; } catch (Exception $e) { echo "Caught Exception ('{$e->getMessage()}')\n{$e}\n"; } } echo '<pre>' . exceptionTest() . '</pre>'; ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Class 'TestException' not found in /in/iaD3F:5 Stack trace: #0 /in/iaD3F(15): exceptionTest() #1 {main} thrown in /in/iaD3F on line 5
Process exited with code 255.
Output for hhvm-3.12.0
Fatal error: Class undefined: TestException in /in/iaD3F on line -1
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: Class undefined: TestException in /in/iaD3F on line 5
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Class 'TestException' not found in /in/iaD3F on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/iaD3F 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 '{' in /in/iaD3F on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/iaD3F on line 4
Process exited with code 255.