Your IP : 216.73.216.48


Current Path : /hdd/hdd12/install/php/php-7.4.32/ext/reflection/tests/
Upload File :
Current File : //hdd/hdd12/install/php/php-7.4.32/ext/reflection/tests/ReflectionGenerator_getTrace.phpt

--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) {
    }
  }
}