3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function a() { yield b(); yield b(); } function b() { yield 1 => 2; } foreach (a() as $a => $b) { print $a; print $b; }
based on NkMT4
Output for 7.1.0 - 7.2.0
0 Recoverable fatal error: Object of class Generator could not be converted to string in /in/85cOJ on line 14
Process exited with code 255.
Output for 5.5.24 - 7.0.20
0 Catchable fatal error: Object of class Generator could not be converted to string in /in/85cOJ on line 14
Process exited with code 255.
Output for 5.4.2 - 5.4.45
Parse error: syntax error, unexpected 'b' (T_STRING) in /in/85cOJ on line 4
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/85cOJ on line 4
Process exited with code 255.