1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
--TEST-- Bug #72373: TypeError after Generator function w/declared return type finishes --FILE-- <?php function foo() : Generator { yield 1; yield 2; yield 3; } foreach (foo() as $bar) { echo $bar . "\n"; } ?> --EXPECT-- 1 2 3