3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = function() { try { yield 1; } finally { throw new Exception(); } }; $b = function() { yield 1; }; echo "starting "; try { foreach ($a() as $x) { foreach ($b() as $y) { return true; } } } catch (Exception $e) { echo "caught exception.\n"; } echo "exit.\n";
based on N5B6A
Output for 7.0.0 - 7.2.0
starting caught exception. exit.
Output for 5.5.24 - 5.6.28
starting
Process exited with code 139.
Output for 5.4.11 - 5.4.45
Parse error: syntax error, unexpected '1' (T_LNUMBER) in /in/qPrD1 on line 6
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_LNUMBER in /in/qPrD1 on line 6
Process exited with code 255.