mirror of
https://github.com/php/php-src.git
synced 2024-12-17 05:50:14 +08:00
de6e401e05
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.
38 lines
731 B
PHP
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()
|