3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo () { yield 'hello'; yield ' '; yield 'world!'; yield from bar(); } function bar () { yield 'again'; yield ' '; yield 'yeah'; } foreach (foo() as $str) { echo $str."\n"; }
based on BB26K
Output for 7.0.0 - 7.2.0
hello world! again yeah
Output for 5.5.24 - 5.6.28
Parse error: syntax error, unexpected 'bar' (T_STRING) in /in/UtdGq on line 8
Process exited with code 255.
Output for 5.4.2 - 5.4.45
Parse error: syntax error, unexpected ''hello'' (T_CONSTANT_ENCAPSED_STRING) in /in/UtdGq on line 4
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /in/UtdGq on line 4
Process exited with code 255.