title: get parent extends class in php
body: <p>i have the oop php code:</p>
  
  <pre><code>class a {
      // with properties and functions
  }
  
  class b extends a {
      public function test() {
          echo __CLASS__; // this is b
          // parent::__CLASS__ // error
      }
  }
  
  $b = new b();
  $b-&gt;test();
  </code></pre>
  
  <p>I have a few parent class (normal and abstract) and many child classes. The child classes extend the parent classes. So when I instantiate the child at some point I need to find out what parent I called.</p>
  
  <p>for example the function <code>b::test()</code> will return <code>a</code></p>
  
  <p>How can I get (from my code) the class <code>a</code> from my class b?</p>
  
  <p>thanks</p>