1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/reflection/tests/ReflectionGenerator_getTrace.phpt
2020-02-03 22:52:20 +01:00

54 lines
650 B
PHP

--TEST--
ReflectionGenerator::getTrace() over multiple Generators
--FILE--
<?php
function foo() {
yield 1;
yield 2;
}
function bar()
{
yield from foo();
}
function baz()
{
yield from bar();
}
$gen = baz();
$gen->valid();
var_dump((new ReflectionGenerator($gen))->getTrace());
?>
--EXPECTF--
array(2) {
[0]=>
array(4) {
["file"]=>
string(%d) "%s"
["line"]=>
int(%d)
["function"]=>
string(3) "foo"
["args"]=>
array(0) {
}
}
[1]=>
array(4) {
["file"]=>
string(%d) "%s"
["line"]=>
int(%d)
["function"]=>
string(3) "bar"
["args"]=>
array(0) {
}
}
}