mirror of
https://github.com/php/php-src.git
synced 2024-12-02 22:34:55 +08:00
21 lines
246 B
PHP
21 lines
246 B
PHP
--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
|