1--TEST--
2Deep recursion with yield from
3--FILE--
4<?php
5ini_set("memory_limit", "512M");
6
7function from($i) {
8    yield $i;
9}
10
11function gen($i = 0) {
12    if ($i < 50000) {
13        yield from gen(++$i);
14    } else {
15        yield $i;
16        yield from from(++$i);
17    }
18}
19
20foreach (gen() as $v) {
21    var_dump($v);
22}
23?>
24--EXPECT--
25int(50000)
26int(50001)
27