小白教程
所有教程
关于
Search
172.69.58.117
172.69.58.117
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Func error debug backtrace”的源代码
本页内容
下一节:
Func_error_debug_print_backtrace
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:debug_backtrace()}}[[Category:PHP Error 错误参考手册|1]] = PHP debug_backtrace() 函数 = [[:Category:PHP Error 错误参考手册]] == 定义和用法 == debug_backtrace() 函数生成 backtrace。 该函数显示由 debug_backtrace() 函数代码生成的数据。 返回一个关联数组。下面是可能返回的元素: {| class="table table-striped table-hover" !width="33%"| 名称 !width="33%"| 类型 !width="33%"| 描述 |- | function | string | 当前的函数名。 |- | line | integer | 当前的行号。 |- | file | string | 当前的文件名。 |- | class | string | 当前的类名。 |- | object | object | 当前对象。 |- | type | string | 当前的调用类型,可能的调用: * 返回:"->" - 方法调用 * 返回:"::" - 静态方法调用 * 返回 nothing - 函数调用 |- | args | array | 如果在函数中,列出函数参数。如果在被引用的文件中,列出被引用的文件名。 |} == 语法 == <pre> debug_backtrace() </pre> <sample title="" desc="" lang="php" hererun="1"> <?php function one($str1, $str2) { two("Glenn", "Quagmire"); } function two($str1, $str2) { three("Cleveland", "Brown"); } function three($str1, $str2) { print_r(debug_backtrace()); } one("Peter", "Griffin"); ?> </sample> 上面代码的输出如下所示: <pre> Array ( [0] => Array ( [file] => C:webfoldertest.php [line] => 7 [function] => three [args] => Array ( [0] => Cleveland [1] => Brown ) ) [1] => Array ( [file] => C:webfoldertest.php [line] => 3 [function] => two [args] => Array ( [0] => Glenn [1] => Quagmire ) ) [2] => Array ( [file] => C:webfoldertest.php [line] => 14 [function] => one [args] => Array ( [0] => Peter [1] => Griffin ) ) ) </pre> [[:Category:PHP Error 错误参考手册]]
返回至“
Func error debug backtrace
”。
下一节:
Func_error_debug_print_backtrace