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 { return 4; } } })());
based on Gtvjv
Output for 7.0.0 - 7.2.0
int(4)
Output for 5.5.24 - 5.6.28
Parse error: syntax error, unexpected '(' in /in/E18Xo on line 9
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/E18Xo 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/E18Xo on line 6
Process exited with code 255.