debug_print_backtrace

(PHP 5, PHP 7)

debug_print_backtrace 锟斤拷印一锟斤拷锟斤拷锟捷★拷

说锟斤拷

debug_print_backtrace ([ int $options = 0 [, int $limit = 0 ]] ) : void

debug_print_backtrace() 锟斤拷印锟斤拷一锟斤拷 PHP 锟斤拷锟捷★拷锟斤拷锟斤拷印锟剿猴拷锟斤拷锟斤拷锟矫★拷锟斤拷 included/required 锟斤拷锟侥硷拷锟斤拷 eval() 锟侥达拷锟诫。

锟斤拷锟斤拷

options

锟斤拷 5.3.6 锟斤拷始锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟窖★拷锟斤拷位锟斤拷锟诫:

debug_print_backtrace() 选锟斤拷
DEBUG_BACKTRACE_IGNORE_ARGS 锟角凤拷锟斤拷锟� "args" 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟叫碉拷 function/method 锟侥诧拷锟斤拷锟斤拷锟杰癸拷锟斤拷省锟节存开锟斤拷锟斤拷

limit

锟斤拷 5.4.0 锟斤拷始锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷芄锟斤拷锟斤拷锟斤拷锟斤拷品锟斤拷囟锟秸恢★拷锟斤拷锟斤拷锟斤拷锟� 默锟斤拷为 (limit=0) 锟斤拷锟斤拷锟斤拷锟斤拷锟叫的讹拷栈帧锟斤拷

锟斤拷锟斤拷值

没锟叫凤拷锟斤拷值锟斤拷

锟斤拷锟斤拷锟斤拷志

锟芥本 说锟斤拷
5.4.0 锟斤拷锟斤拷丝锟窖★拷牟锟斤拷锟� limit锟斤拷
5.3.6 锟斤拷锟斤拷丝锟窖★拷牟锟斤拷锟� options锟斤拷

锟斤拷锟斤拷

Example #1 debug_print_backtrace() 锟斤拷锟斤拷

<?php
// include.php file

function a() {
    
b();
}

function 
b() {
    
c();
}

function 
c(){
    
debug_print_backtrace();
}

a();

?>
<?php
// 锟侥硷拷 test.php
// 锟斤拷锟斤拷锟斤拷应锟斤拷锟斤拷锟叫碉拷锟侥硷拷

include 'include.php';
?>

锟斤拷锟斤拷锟斤拷锟教碉拷锟斤拷锟斤拷锟斤拷锟斤拷冢锟�

#0  c() called at [/tmp/include.php:10]
#1  b() called at [/tmp/include.php:6]
#2  a() called at [/tmp/include.php:17]
#3  include(/tmp/include.php) called at [/tmp/test.php:3]

锟轿硷拷

  • debug_backtrace() - 锟斤拷锟斤拷一锟斤拷锟斤拷锟捷革拷锟斤拷(backtrace)