determining caller of function
| From: | Thomas Peri | Date: | Wed, 24 Nov 2004 18:25:29 +0000 |
| Subject: | determining caller of function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-202777@lists.php.net to get a copy of this message | ||
Is there a way, *other than using debug_backtrace(), which has a bug*, to determine from inside what class and method the current function was called? For example:
class Foo {
function fubar() {
// I want to be able to determine that the function from which this
// method was called in this example is the "go" method of the class "Bar".
}
}
class Bar{
function go() {
$f = new Foo();
$f->fubar();
}
}
$b = new Bar();
$b->go();
--
Thanks,
- Thomas