1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 02:02:32 +01:00
Files
archived-php-src/Zend/tests/generators/backtrace.phpt
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

28 lines
414 B
PHP

--TEST--
Printing the stack trace in a generator
--FILE--
<?php
function f1() {
debug_print_backtrace();
}
function f2($arg1, $arg2) {
f1();
yield; // force generator
}
function f3($gen) {
$gen->rewind(); // trigger run
}
$gen = f2('foo', 'bar');
f3($gen);
?>
--EXPECTF--
#0 %s(%d): f1()
#1 [internal function]: f2('foo', 'bar')
#2 %s(%d): Generator->rewind()
#3 %s(%d): f3(Object(Generator))