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
廣告