1--TEST--
2Leaf link may need to be invalidated depending on dtor order
3--FILE--
4<?php
5
6function gen2() {
7    yield 1;
8}
9function gen() {
10    yield from gen2();
11}
12function bar($g) {
13    yield from $g;
14}
15
16$gen = gen();
17$bar = bar($gen);
18var_dump($bar->current());
19$copy = $bar;
20unset($gen);
21
22?>
23--EXPECT--
24int(1)
25