PHP - debug_print_backtrace() 函数



语法

void debug_print_backtrace ( void );

定义和用法

此函数打印 PHP 回溯。它打印函数调用、包含/需要文件和 eval()ed 内容。

参数

序号 参数 & 说明
1

void

无。

返回值

不返回任何值。

示例

以下是此函数的用法:

<?php
   function one() {
      two();
   }
   
   function two() {
      three();
   }
   
   function three(){
      debug_print_backtrace();
   }
   one();
?> 

这将产生以下结果:

#0  three() called at [/var/www/tutorialspoint/php/test.php:7]
#1  two() called at [/var/www/tutorialspoint/php/test.php:3]
#2  one() called at [/var/www/tutorialspoint/php/test.php:13]
php_function_reference.htm
广告
© . All rights reserved.