Skip to content

Commit d0abc2d

Browse files
committed
Fix #369: Add test.
1 parent cc0dc47 commit d0abc2d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

jphp-core/tests/resources/generators/bug369.phpt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ yield can be used without a value
66
$a = function() { var_dump((yield)['a']); };
77
$a()->send(['a' => 'pony']);
88

9+
function a() {
10+
yield 77;
11+
return ['a' => 'pony'];
12+
}
13+
$a = function() { var_dump((yield from a())['a']); };
14+
15+
foreach ($a() as $v) {
16+
var_dump($v);
17+
}
18+
919
?>
1020
--EXPECT--
21+
string(4) "pony"
22+
int(77)
1123
string(4) "pony"

0 commit comments

Comments
 (0)