3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php try { echo "line 1\n"; throw new RuntimeException('exception 1'); } catch (RuntimeException $e) { echo "line 2\n"; throw new Exception('exception 2', null, $e); } catch (Exception $e) { echo "line 3\n"; } finally { echo "line 4\n"; }
Output for 7.0.0 - 7.2.0
line 1 line 2 line 4 Fatal error: Uncaught RuntimeException: exception 1 in /in/Vehjf:5 Stack trace: #0 {main} Next Exception: exception 2 in /in/Vehjf:8 Stack trace: #0 {main} thrown in /in/Vehjf on line 8
Process exited with code 255.
Output for 5.5.24 - 5.6.28
line 1 line 2 line 4 Fatal error: Uncaught exception 'RuntimeException' with message 'exception 1' in /in/Vehjf:5 Stack trace: #0 {main} Next exception 'Exception' with message 'exception 2' in /in/Vehjf:8 Stack trace: #0 {main} thrown in /in/Vehjf on line 8
Process exited with code 255.
Output for 5.3.21 - 5.4.45
Parse error: syntax error, unexpected '{' in /in/Vehjf on line 11
Process exited with code 255.