Name
debug_backtrace
Synopsis
array debug_backtrace([ intoptions[, intlimit]])
Returns an array of associative arrays containing a backtrace of where PHP is currently executing. One element is included per function or file include, with the following elements:
| If in a function, the function’s name as a string |
| The line number within the file where the current function or file include is located |
| The name of the file the element is in |
| If in an object instance or class method, the name of the class the element is in |
| If in an object, that object’s name |
| The current call type: :: if a static method; -> if a method; nothing if a function |
| If in a function, the arguments used to call that function; if in a file include, the include file’s name |
Each function call or file include generates a new element in the array. The innermost function call or file include is the element with an index of zero; further elements are less deep function calls or file includes.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access