Possible Duplicate:
Find out which class called a method in another class.
Hello everyone,
I have a class and I can't find where his object creates. I mean, can I somehow find out who calls his constructor?
Thanks a lot, Andrey.
Possible Duplicate:
Find out which class called a method in another class.
Hello everyone,
I have a class and I can't find where his object creates. I mean, can I somehow find out who calls his constructor?
Thanks a lot, Andrey.
use
$trace = debug_backtrace();
echo "<pre>".print_r($trace[1])."</pre>";
//see all the displays '1' is the referrer '0' is self
echo $callingfunction = $trace[1]['function'];
echo $callingclass = $trace[1]['class'];