/** * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct(ContextObject $contextObject, ChildRequiredObject $childRequiredObject, ParentRequiredObject $parentRequiredObject, array $parentRequiredScalar, array $childRequiredScalar, ParentOptionalObject $parentOptionalObject = null, array $data = [], array $parentOptionalScalar = [], ChildOptionalObject $childOptionalObject = null, array $childOptionalScalar = []) { $this->childRequiredObject = $childRequiredObject; $this->childRequiredScalar = $childRequiredScalar; $this->childOptionalObject = $childOptionalObject; $this->childOptionalScalar = $childOptionalScalar; parent::__construct($contextObject, $parentRequiredObject, $parentRequiredScalar, $parentOptionalObject, $data, $parentOptionalScalar); }
public function __construct() { /** * parent construct function should override * if the child or extended class has the * same functionality in the construct function * Run the parent construction function */ parent::__construct(); echo __CLASS__ . ' has been extended and instantied to ' . parent::selfClass() . '<br> '; }
/** * SubClass constructor. */ public function __construct() { parent::__construct('someparam'); }
public function __construct($name, $lastname, $age) { parent::__construct($name, $lastname); $this->age = $age; }
function __construct() { parent::__construct(); echo 'using sub-class constructor'; }