title: Dynamically checking if class name is a child class of XYZ in php
body: <pre><code>class A {}
  class B extends A {}
  class C extends A {}
  class D extends C {}
  
  $class="C";
  if ($class instanceof A) {  //This is just for demonstration - I know instanceof won't work!!!
     $object=new $class("","",1)
  }
  </code></pre>
  
  <p>How can a check the string "C" to check that this classname is a child of A?</p>
  
  <p>I looked into <code>is_a()</code> but it doesn't help.</p>
  
  <p>I am specifically asking for "C" as I am getting the class name dynamically and I can't instantiate without knowing what parameters to pass to constructor!</p>