Name
debug_backtrace
Synopsis
array debug_backtrace(void)
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 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.
Get Programming PHP, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.