Page 1 of 1

Stack trace

Posted: Wed Jan 30, 2008 7:52 am
by Timwi
Hi,

Is it possible to generate a stack trace in PHP?

If an error occurs somewhere, often it is not enough to know which function the error occurred in; it is often necessary to know where this function was called, and where the function containing that call was called etc. Is this possible?

Thanks in advance!

Re: Stack trace

Posted: Wed Jan 30, 2008 8:00 am
by Zoxive

Code: Select all

debug_backtrace();

Re: Stack trace

Posted: Wed Jan 30, 2008 8:08 am
by Timwi
Zoxive wrote:

Code: Select all

debug_backtrace();
Thanks. Typical nonsensical PHP function naming again. If it was properly called stacktrace, I would have found it.