Stack trace

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Timwi
Forum Newbie
Posts: 2
Joined: Wed Jan 30, 2008 7:48 am

Stack trace

Post 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!
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: Stack trace

Post by Zoxive »

Code: Select all

debug_backtrace();
Timwi
Forum Newbie
Posts: 2
Joined: Wed Jan 30, 2008 7:48 am

Re: Stack trace

Post 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.
Post Reply