title: Calling a PHP constructor from its own method
body: <p>I've been looking for a way to call a class's constructor that is analogous to "parent::_<em>construct" but for the class itself (something like "self::</em>_construct", though that doesn't work).  Why do this?  Consider the following (which doesn't work, btw)...</p>
  
  <pre><code>class A {
    var $name;
    function __construct($name) {
      $this-&gt;name = $name;
    }
    function getClone($name) {
      $newObj = self::__construct($name);
      return $newObj;
    }
  }
  
  class B extends A {
  }
  </code></pre>
  
  <p>In the real implementation there are other properties that will differentiate class B from class A, but both should have the "getClone" method.  If called on an object of class A it should yield another object of class A, and if called on class B it should yield another object of class B.</p>
  
  <p>Of course I could do this by just overriding "getClone" in class B and hard-coding the class name into the method (i.e., $newObj = new B($name)), but it would be much nicer to just code the method once, telling it to instantiate an object of its own class, whatever that class may be.</p>
  
  <p>Will PHP let me do this?</p>