title: Find out which class called a method in another class
body: <p>Is there a way in PHP to find out what object called what method in another object.</p>
  
  <p>Exmaple:</p>
  
  <pre><code>class Foo
  {
    public function __construct()
    {
      $bar = new Bar();
      $bar-&gt;test();
    }
  }
  
  class Bar
  {
    public function test()
    {
    }
  }
  $foo = new Foo();
  </code></pre>
  
  <p>Would there be a way for me to find out that the test method was called from the foo object?</p>