class Point
{
function __construct($x = 0, $y = 0, $z = 0)
{
$this->x = $x;
$this->y = $y;
$this->z = $z;
}
public function show() {
echo "($this->x, $this->y, $this->z)";
}
}
class Point2D extends Point {
function __construct($x = 0, $y = 0) {
parent::__construct($x, $y, 0);
}
}
$p = new Point2D(10, 20);
$p->show();