PHP debug_print_backtrace() 函式
示例
列印 PHP 回溯資訊
<?php
function a($txt) {
b("Glenn");
}
function b($txt) {
c("Cleveland");
}
function c($txt) {
debug_print_backtrace();
}
a("Peter");
?>
自己動手試一試 »定義和用法
debug_print_backtrace() 函式會列印 PHP 的回溯資訊。
此函式顯示導致呼叫 debug_print_backtrace() 函式的程式碼資料。
語法
debug_print_backtrace(options, limit);
引數值
引數 | 描述 |
---|---|
選項 | 可選。指定以下選項的位掩碼:DEBUG_BACKTRACE_IGNORE_ARGS (是否忽略 "args" 索引以及所有函式/方法引數,以節省記憶體) |
limit | 可選。限制列印的堆疊幀數。預設 (limit=0) 列印所有堆疊幀 |
技術詳情
返回值 | 無 |
---|---|
PHP 版本 | 5.0+ |
PHP 更新日誌 | PHP 5.4: 添加了可選引數 limit PHP 5.3.6: 添加了可選引數 options |
PHP 錯誤參考