3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php try { try { try { try { throw new Exception(1); } catch (Exception $e) { throw $e; } } 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 HpeuJ
Output for 7.1.0 - 7.3.1
3 Exception: 1 in /in/YeLkA:7 Stack trace: #0 {main} Next Exception: 2 in /in/YeLkA:12 Stack trace: #0 {main} Next Exception: 3 in /in/YeLkA:15 Stack trace: #0 {main}
Output for 7.0.0 - 7.0.20
3 Exception: 3 in /in/YeLkA:15 Stack trace: #0 {main}
Output for 5.5.24 - 5.6.28
3 exception 'Exception' with message '1' in /in/YeLkA:7 Stack trace: #0 {main} Next exception 'Exception' with message '2' in /in/YeLkA:12 Stack trace: #0 {main} Next exception 'Exception' with message '3' in /in/YeLkA:15 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/YeLkA on line 14
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/YeLkA on line 14
Process exited with code 255.