3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { try { throw new Exception("ex1"); } finally { try { throw new Exception("ex2"); } catch (Exception $e) { echo "caught exception in finally block: $e ....\n"; } echo "end of finally.\n"; } } try { foo(); echo "this should not be executed.\n" } catch (Exception $e) { echo "caught exception from foo() call: $e ....\n"; }
Output for 5.5.24 - 5.5.29, 5.6.8 - 5.6.13
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /in/aXdC9 on line 19
Process exited with code 255.
Output for 5.4.2 - 5.4.45
Parse error: syntax error, unexpected 'finally' (T_STRING), expecting catch (T_CATCH) in /in/aXdC9 on line 6
Process exited with code 255.

preferences:
182.94 ms | 1395 KiB | 62 Q