assuming they are instance variables it's perfectly fine, as long as base class constructor is used to ensure class is properly initialized.
class Base {
function __construct($height, $width) {
$this->height = $height;
$this->width = $width;
}
function getHeight() {
return $this->height;
}
function getWidth() {
return $this->width();
}
}
class Child extends Base {
function __construct($height, $width, $extra) {
parent::__construct($height, $width);
$this->extra = $extra * $this->getHeight();
}
function getExtra() {
return $this->extra;
}
}
$c = new Child(10, 20, 40);
echo $c->getExtra() . "\n";