1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 01:18:19 +02:00
Files
archived-php-src/Zend/tests/generators/backtrace_multi_yield_from.phpt
T
Nikita Popov de6e401e05 Use common formatting for backtraces (#6977)
This makes debug_print_backtrace() use the same formatting as exception
backtraces. The only difference is that the final #{main} is omitted,
because it wouldn't make sense for limited backtraces, and wasn't there
previously either.
2021-05-18 11:43:37 +02:00

33 lines
490 B
PHP

--TEST--
Generator backtrace with multi yield from
--FILE--
<?php
function gen() {
yield 1;
debug_print_backtrace();
yield 2;
}
function from($gen) {
yield from $gen;
}
$gen1 = gen();
$gen2 = from($gen1);
$gen3 = from($gen2);
var_dump($gen3->current());
$gen2->next();
var_dump($gen2->current());
$gen2->next();
var_dump($gen2->current());
?>
--EXPECTF--
int(1)
int(1)
#0 %s(10): gen()
#1 [internal function]: from(Object(Generator))
#2 %s(19): Generator->next()
int(2)