3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gen1() { return [4, 5, 6] } function gen2() { yield from gen1(); } $g = gen2(); foreach($g as $val) { var_dump($val); } var_dump($g->getReturn());
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.30, 5.6.8 - 5.6.14
Parse error: syntax error, unexpected '}' in /in/aQCGZ on line 5
Process exited with code 255.

preferences:
186.27 ms | 1395 KiB | 64 Q