xref: /PHP-8.1/Zend/tests/bug72373.phpt (revision 792e8938)
1--TEST--
2Bug #72373: TypeError after Generator function w/declared return type finishes
3--FILE--
4<?php
5
6function foo() : Generator {
7    yield 1;
8    yield 2;
9    yield 3;
10}
11
12foreach (foo() as $bar) {
13    echo $bar . "\n";
14}
15
16?>
17--EXPECT--
181
192
203
21