xref: /php-src/Zend/tests/generators/bug80240.phpt (revision dd4a0801)
1--TEST--
2Bug #80240: Use after free multi yield from
3--FILE--
4<?php
5
6function gen() {
7    yield 0;
8    yield from gen();
9}
10
11function bar($gen) {
12    yield from $gen;
13}
14
15$gen = gen();
16$a = bar($gen);
17$b = bar($gen);
18$a->rewind();
19$b->rewind();
20$a->next();
21unset($gen);
22unset($a);
23unset($b);
24
25?>
26===DONE===
27--EXPECT--
28===DONE===
29