How can I get the call stack from Fatal Error?
I am getting a fatal error "Call to a member function on a non-object"
in a PHP script, but I cannot track down exactly where this is happening, or why. The error message is pretty unhelpful as the line it describes works 99.9% of the time.
Is there a way to get the current call stack, keep track of what calls are in progress before this fatal error, or do anything else to help track down this error?
source to share
please see my answer and others also for different possibilities
How to catch a fatal PHP error
Obviously this is partly related in the sense that it only catches a fatal error. You can modify the function to catch other types of errors. The starting point for this is:
if($error['type'] == 1){
These methods override the Xdebug output if the installation is already done.
Best regards, sahunzai
source to share
Use debug_print_backtrace()
- http://us2.php.net/manual/en/function.debug-print-backtrace.php
source to share