3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function fred() { echo "dino"; } function barney() { foreach (range(1, 10) as $x) { yield fred(); } } echo barney();
based on Paji4
Output for 7.1.0 - 7.2.0
Recoverable fatal error: Object of class Generator could not be converted to string in /in/1WVsA on line 12
Process exited with code 255.
Output for 5.5.24 - 7.0.20
Catchable fatal error: Object of class Generator could not be converted to string in /in/1WVsA on line 12
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Parse error: syntax error, unexpected 'fred' (T_STRING) in /in/1WVsA on line 9
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/1WVsA on line 9
Process exited with code 255.