3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = function () { yield 1; echo 'hello'; yield 2; yield 3; echo 'world'; yield 4; } foreach ($x() as $y) { echo $y; }
Output for 5.6.0 - 5.6.27, 7.0.0 - 7.0.12
Parse error: syntax error, unexpected 'foreach' (T_FOREACH) in /in/20OZd on line 13
Process exited with code 255.

preferences:
167.41 ms | 1395 KiB | 48 Q