echo $car->getSpeed(); 为何没返回结果
speed; } protected function speedUp() {$this->speed += 10; } public function start(){ return $this->speedUp(); } } $car = new Car(); echo $car->start(); echo $car->getSpeed(); 为何显示的结果只有20 下面那个10去哪里了
speed; } protected function speedUp() {$this->speed += 10; } public function start(){ return $this->speedUp(); } } $car = new Car(); echo $car->start(); echo $car->getSpeed(); 为何显示的结果只有20 下面那个10去哪里了
2016-04-28
举报