3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function first() { yield from another(); } function another() { yield "test"; } foreach (first() as $string) { echo $string . "\n"; }
based on 2MdK1
Output for 7.0.0 - 7.2.0
test
Output for 5.5.24 - 5.6.28
Parse error: syntax error, unexpected 'another' (T_STRING) in /in/H7FuP on line 4
Process exited with code 255.
Output for 5.4.1 - 5.4.45
Parse error: syntax error, unexpected 'from' (T_STRING) in /in/H7FuP 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/H7FuP on line 4
Process exited with code 255.