それはあなたのコードに依存します。親コンストラクターを呼び出さないと何も起こりませんが、親コンストラクターが親クラスの初期化を行う場合、それはすべて省略されます。考えて、これで遊んでください:
<?php
class X {
private $_a;
public function __construct($a) {
echo 'X::construct ';
$this->_a = $a;
}
public function getA() {
return $this->_a;
}
}
class Y extends X {
private $_b;
public function __construct($a,$b) {
echo 'Y::construct ';
parent::__construct($a);
$this->_b = $b;
}
public function getAB() {
return $this->_b + $this->getA();
}
}
$n = new Y(3,2);
echo $n->getAB();
これを実行すると、(他のダンプの中でも) 5 が出力されることが簡単にわかります。class Yしかし、 parent callをコメントするとparent::__construct($a);、2 になります。これがこの場合の結果です。