< ?php
class a{
public $x;
public $y;
function __construct($x=0,$y=0){
$this->x=$x;
$this->y=$y;
}
function getx(){
return $this->x;
}
function gety(){
return $this->y;
}
function __destruct(){}
}
class a2 extends a{}
/*extends是一个继承函数*/
$b2=new a2(10,10);
echo $b2->getx()."<br>";
echo $b2->gety();
?>