3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A extends Exception {} class B extends Exception {} try { throw new A('a'); } catch (A $e) { var_dump($e->getMessage()); throw new B('b'); } catch (Exception $e) { var_dump($e->getMessage()); }
Output for 7.0.0 - 7.1.0
string(1) "a" Fatal error: Uncaught B: b in /in/6F1Am:10 Stack trace: #0 {main} thrown in /in/6F1Am on line 10
Process exited with code 255.
Output for hhvm-3.12.0
string(1) "a" Fatal error: Uncaught exception 'B' with message 'b' in /in/6F1Am:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
string(1) "a" Fatal error: Uncaught exception 'B' with message 'b' in /in/6F1Am:10 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.0.0 - 5.0.2, 5.0.5 - 5.6.28
string(1) "a" Fatal error: Uncaught exception 'B' with message 'b' in /in/6F1Am:10 Stack trace: #0 {main} thrown in /in/6F1Am on line 10
Process exited with code 255.
Output for 5.0.3 - 5.0.4
string(1) "a" Fatal error: Uncaught exception 'B' with message 'b' in /in/6F1Am:10 Stack trace: #0 /in/6F1Am(10): unknown() #1 {main} thrown in /in/6F1Am on line 10
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/6F1Am on line 6
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/6F1Am on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/6F1Am on line 6
Process exited with code 255.