xref: /PHP-8.0/Zend/tests/generators/bug74157.phpt (revision f8d79582)
1--TEST--
2Bug #74157 (Segfault with nested generators)
3--FILE--
4<?php
5
6function a() {
7    $a = $b = $c = 2;
8    foreach(range(1, 5) as $v) {
9        yield $v;
10    }
11    return;
12}
13
14foreach (a(range(1, 3)) as $a) {
15    var_dump($a);
16}
17?>
18--EXPECT--
19int(1)
20int(2)
21int(3)
22int(4)
23int(5)
24