Hello,
Is it possible to traceback recent functions? For example in lets assume that I run function A, B, then C. In function C is there a way to find out that function A and B werre previously run without setting any variables during their execution? I'm familiar with __FUNCTION__ but that only gives the current function (I believe).
There is also debug_backtrace() but that seems to just list the magic variables, thus only listing the current function.
Thanks for any help!
function backtrace possible?
Moderator: General Moderators
-
jpschroeder
- Forum Newbie
- Posts: 4
- Joined: Tue May 27, 2008 9:54 am
Re: function backtrace possible?
For anyone interested...
I somewhat solved the issue with debug_traceback(), but its quite rough. You receive an array full of information on previous functions that have been run.
To access previous functions you would use this format:
If anyone has better information that would be awesome!
I somewhat solved the issue with debug_traceback(), but its quite rough. You receive an array full of information on previous functions that have been run.
To access previous functions you would use this format:
Code: Select all
$function = degub_backtrace();
$function[0]['function'] // The current function
$function[1]['function'] // Most recently executed function before this one
$function[2]['function'] // Second most recently executed function before this one etc...