From 8ef688392f0d31ae212edbd42605857267c01f98 Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Sun, 19 Jan 2003 06:19:23 +0000 Subject: [PATCH] Initial commit of this fine function. It may need a little touching up :) This closes bug #21515 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@112639 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../errorfunc/functions/debug-backtrace.xml | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100755 reference/errorfunc/functions/debug-backtrace.xml diff --git a/reference/errorfunc/functions/debug-backtrace.xml b/reference/errorfunc/functions/debug-backtrace.xml new file mode 100755 index 0000000000..42f2055bb0 --- /dev/null +++ b/reference/errorfunc/functions/debug-backtrace.xml @@ -0,0 +1,167 @@ + + + + + debug_backtrace + + Generates a backtrace + + + + Description + + arraydebug_backtrace + + + + debug_backtrace generates a PHP backtrace + and returns this information as an associative array. The + possible returned elements are listed in the following table: + + + + Possible returned elements from <function>debug_backtrace<?function> + + + + Name + Type + Description + + + + + function + string + + The current function name. See also + __FUNCTION__. + + + + line + integer + + The current line number. See also + __LINE__. + + + + file + string + + The current file name. See also + __FILE__. + + + + class + string + + The current class name. See also + __CLASS__ + + + + type + string + + The current class type. + + + + args + array + + If inside a function, this lists the functions arguments. If + inside a included file, this lists the included file name(s). + + + + +
+
+ + The following is a simple example. + + + + + <function>debug_backtrace</function> example + + + + +// filename: b.php + + +/* Results when executing /tmp/b.php + +Hi: friend +array(2) { + [0]=> + array(4) { + ["file"] => string(10) "/tmp/a.php" + ["line"] => int(10) + ["function"] => string(6) "a_test" + ["args"]=> + array(1) { + [0] => &string(6) "friend" + } + } + [1]=> + array(4) { + ["file"] => string(10) "/tmp/b.php" + ["line"] => int(2) + ["args"] => + array(1) { + [0] => string(10) "/tmp/a.php" + } + ["function"] => string(12) "include_once" + } +} +*/ +]]> + + + + + See also trigger_error. + +
+
+ +