O'Reilly logo

Programming PHP, 3rd Edition by Peter MacIntyre, Kevin Tatroe, Rasmus Lerdorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

debug_backtrace

Synopsis

array debug_backtrace([ int options [, int limit ]])

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:

function

If in a function, the function’s name as a string

line

The line number within the file where the current function or file include is located

file

The name of the file the element is in

class

If in an object instance or class method, the name of the class the element is in

object

If in an object, that object’s name

type

The current call type: :: if a static method; -> if a method; nothing if a function

args

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required