title: How do I call the parent classes constructor with its original parameters in PHP
body: <p>I have this code:</p>
  
  <pre><code>class A {
    var $arr = array();
  
    function __construct($para) {
      echo 'Not called';
    }
  }
  
  class B extends A {
    function __construct() {
      $arr[] = 'new Item';
    }
  }
  </code></pre>
  
  <p>And as B has its own constructor construct($para) of A never gets called.</p>
  
  <p>Now I could call parent::__construct($para) but then class B would need to be aware of the parameters class A needs.</p>
  
  <p>I would prefer this:</p>
  
  <pre><code>class A {
    var $arr = array();
  
    function __construct($para) {
      echo 'Not called';
    }
  }
  
  class B extends A {
    function __construct() {
      parent::__construct(); // With the parameters class B was created.
  
      // Additional actions that do not need direct access to the parameters
      $arr[] = 'new Item';
    }
  }
  </code></pre>
  
  <p>Would something like that work?</p>
  
  <p>I don't like the fact, that all classes that extend class A would need to define a new constructor, once class A changes its parameters, where all I want them to do is call the constructor of class A like when class B does not overwrite it with an own __construct() method.</p>