3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $generator = function() { foreach (range(0, 10) as $item { yield $item; } }; foreach ($generator() as $generator) { var_dump($generator); $generator = $generator; var_dump($generator); } var_dump($generator);
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected '$item' (T_VARIABLE) in /in/c7Qee on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/c7Qee on line 4
Process exited with code 255.