Generate a PHP backtrace:
The above code will output something like this:
The debug_backtrace() function generates a PHP backtrace.
This function displays data from the code that led up to the debug_backtrace() function.
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: |
limit | Optional. Limits the number of stack frames printed. By default (limit=0) it prints all stack frames |
Return Value: | None |
---|---|
PHP Version: | 4.3+ |
PHP Changelog: | PHP 5.4: The optional parameter limit was added PHP 5.3.6: The parameter provide_object was changed to options and additional option DEBUG_BACKTRACE_IGNORE_ARGS is added PHP 5.2.5: The optional parameter provide_object was added PHP 5.1.1: Added the current object as a possible return element |