The debug_backtrace() function generates a PHP backtrace.This function displays data from the code that led up to the debug_backtrace() function.
The above code will output something like this:
Returns an array of associative arrays. The possible returned elements are:
Name | Type | Description |
---|---|---|
function | string | The current function name |
line | integer | The current line number |
file | string | The current file name |
class | string | The current class name |
object | object | The current object |
type | string | The current call type. Possible calls: |
args | array | If inside a function, it lists the functions arguments. If inside an included file, it lists the included file names |
Parameter | Description |
---|---|
options | Optional. Specifies a bitmask for the following options: DEBUG_BACKTRACE_PROVIDE_OBJECT (Whether or not to populate the "object" index DEBUG_BACKTRACE_IGNORE_ARGS (Whether or not to omit the "args" index, and all the function/method arguments, to save memory) |
limit | Optional. Limits the number of stack frames printed. By default (limit=0) it prints all stack frames |