1--TEST--
2Generator GC when the yield from parent chain does not reach the root
3--FILE--
4<?php
5
6function root() {
7    yield 1;
8    yield 2;
9}
10
11function delegate($gen) {
12    yield from $gen;
13}
14
15$gen = delegate(delegate(root()));
16$gen1 = delegate(delegate($gen));
17$gen2 = delegate(delegate($gen));
18var_dump($gen1->current());
19var_dump($gen2->current());
20$gen1->next();
21$gen1->next();
22gc_collect_cycles();
23
24?>
25--EXPECT--
26int(1)
27int(1)
28