3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function gen() { yield 10 => "gen"; yield "another"; } function yf() { yield from gen(); yield from gen(); } foreach(yf() as $key => $val) { echo "$key => $val\n"; }
based on kmQDS
Output for 7.0.0 - 7.2.0
10 => gen 11 => another 10 => gen 11 => another
Output for 5.5.24 - 5.6.28
Parse error: syntax error, unexpected 'gen' (T_STRING) in /in/ZE8D6 on line 9
Process exited with code 255.
Output for 5.4.9 - 5.4.45
Parse error: syntax error, unexpected '10' (T_LNUMBER) in /in/ZE8D6 on line 4
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_LNUMBER in /in/ZE8D6 on line 4
Process exited with code 255.