为什么要parent::speedUp();觉得这样就可以了吧
//定义继承于Car的Truck类
class Truck extends Car{
public function speedUp(){
$this->speed += 50;
return $this->speed;
}
}
//定义继承于Car的Truck类
class Truck extends Car{
public function speedUp(){
$this->speed += 50;
return $this->speed;
}
}
2017-12-22
举报