RE: [PHP] How to get a function backtrace?
| From: | Martin Towell | Date: | Sun, 13 Jan 2002 22:18:35 +0000 |
| Subject: | RE: [PHP] How to get a function backtrace? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-80382@lists.php.net to get a copy of this message | ||
Hmm... I've been wondering if a function to do this exists too... would be
REALLY handing for debugging!!
Anyone know??
-----Original Message-----
From: Stefan Rusterholz [mailto:scripting@interaktion.ch]
Sent: Friday, January 11, 2002 8:35 PM
To: PHP
Subject: [PHP] How to get a function backtrace?
Im not sure if "function-backtrace" is the correct word for what I need, so
I'll explain:
If I have for example
<?
a();
function a(){
b();
}
function b(){
c();
}
function c(){
$x = function_backtrace();
print_r($x);
}
?>
then I want to get
array(
[0] => 'a',
[1] => 'b',
[2] => 'c'
)
or something similar. So I want to know, what functions have been called. If
you know perl, then adequate function was "caller".
I already searched php.net for it but had no luck for it - so if you please
could point me to the right direction I was very happy.
TIA
Stefan Rusterholz