3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php try { try { try { throw new Exception(1); } catch (Exception $e) { throw new Exception(2, 0, $e); } } finally { throw new Exception(3); } } catch (Exception $e) { echo $e->getMessage() . PHP_EOL; echo $e . PHP_EOL; }
based on fWcK1
Output for 7.1.0 - 7.3.0rc4
3 Exception: 1 in /in/HpeuJ:6 Stack trace: #0 {main} Next Exception: 2 in /in/HpeuJ:8 Stack trace: #0 {main} Next Exception: 3 in /in/HpeuJ:11 Stack trace: #0 {main}
Output for 7.0.0 - 7.0.20
3 Exception: 3 in /in/HpeuJ:11 Stack trace: #0 {main}
Output for 5.5.24 - 5.6.28
3 exception 'Exception' with message '1' in /in/HpeuJ:6 Stack trace: #0 {main} Next exception 'Exception' with message '2' in /in/HpeuJ:8 Stack trace: #0 {main} Next exception 'Exception' with message '3' in /in/HpeuJ:11 Stack trace: #0 {main}
Output for 5.4.10 - 5.4.45
Parse error: syntax error, unexpected 'finally' (T_STRING), expecting catch (T_CATCH) in /in/HpeuJ on line 10
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_STRING, expecting T_CATCH in /in/HpeuJ on line 10
Process exited with code 255.