title: After subclassing, how can I override the parent's constructor while still using it?
body: <p>Example: I have a class called ParentClass. ParentClass has a constructor like this:</p>
  
  <pre><code>function __construct($tpl) {
      // do something with the $tpl
  }
  </code></pre>
  
  <p>When creating a new instance of ParentClass, I must provide that $tpl parameter like this:</p>
  
  <pre><code>$p = new ParentClass('index');
  </code></pre>
  
  <p>Then there's a ChildClass extends ParentClass. I want that the constructor of ChildClass provides that $tpl to ParentClass, but of course I don't want just an instance of ParentClass, but of ChildClass.</p>
  
  <p>So when creating a new ChildClass instance, I want it to look like:</p>
  
  <pre><code>$foo = new ChildClass();
  </code></pre>
  
  <p>But internally, I want it to provide that 'index' to the constructor of ParentClass.</p>
  
  <p>How can I achieve that in PHP?</p>