3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function gen1() { yield 1; yield 2; yield 3; } function gen2(bool $opt) { if ($opt) yield from gen1(); yield 4; yield 5; yield 6; } print_r(iterator_to_array(gen2(true))); print_r(iterator_to_array(gen2(false)));