Is there a way in PHP to find out what object called what method in another object.
Exmaple:
class Foo { public function __construct() { $bar
Here is one liner solution
list(, $caller) = debug_backtrace(false, 2);
As of PHP7 this won't work based on the docs: http://php.net/manual/en/function.list.php as we cannot have empty properties, here is a small update:
list($childClass, $caller) = debug_backtrace(false, 2);