3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump((function () { for ($i = 0; $i < 5; $i++) { try { return $i; } finally { try { if ($i != 3) throw new Exception; } catch (Exception $e) {} } } })());
based on 5NBc5
Output for 7.0.0 - 7.2.0
int(0)
Output for 5.5.24 - 5.6.28
Parse error: syntax error, unexpected '(' in /in/HeW4t on line 12
Process exited with code 255.
Output for 5.4.10 - 5.4.45
Parse error: syntax error, unexpected 'finally' (T_STRING), expecting catch (T_CATCH) in /in/HeW4t on line 6
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/HeW4t on line 6
Process exited with code 255.