1--TEST-- 2ReflectionGenerator::getTrace() over multiple Generators 3--FILE-- 4<?php 5 6function foo() { 7 yield 1; 8 yield 2; 9} 10 11function bar() 12{ 13 yield from foo(); 14} 15 16function baz() 17{ 18 yield from bar(); 19} 20 21$gen = baz(); 22$gen->valid(); 23 24var_dump((new ReflectionGenerator($gen))->getTrace()); 25 26?> 27--EXPECTF-- 28array(2) { 29 [0]=> 30 array(4) { 31 ["file"]=> 32 string(%d) "%s" 33 ["line"]=> 34 int(%d) 35 ["function"]=> 36 string(3) "foo" 37 ["args"]=> 38 array(0) { 39 } 40 } 41 [1]=> 42 array(4) { 43 ["file"]=> 44 string(%d) "%s" 45 ["line"]=> 46 int(%d) 47 ["function"]=> 48 string(3) "bar" 49 ["args"]=> 50 array(0) { 51 } 52 } 53} 54