php-src/Zend/tests/debug_print_backtrace_limit.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

38 lines
731 B
PHP

--TEST--
debug_print_backtrace limit
--FILE--
<?php
function a() {
b();
}
function b() {
c();
}
function c() {
debug_print_backtrace(0, 1);
echo "\n";
debug_print_backtrace(0, 2);
echo "\n";
debug_print_backtrace(0, 0);
echo "\n";
debug_print_backtrace(0, 4);
}
a();
?>
--EXPECTF--
#0 %sdebug_print_backtrace_limit.php(7): c()
#0 %sdebug_print_backtrace_limit.php(7): c()
#1 %sdebug_print_backtrace_limit.php(3): b()
#0 %sdebug_print_backtrace_limit.php(7): c()
#1 %sdebug_print_backtrace_limit.php(3): b()
#2 %sdebug_print_backtrace_limit.php(20): a()
#0 %sdebug_print_backtrace_limit.php(7): c()
#1 %sdebug_print_backtrace_limit.php(3): b()
#2 %sdebug_print_backtrace_limit.php(20): a()