类当中的this是怎么使用的??
class Car {
private $speed = 0;
public function getSpeed() {
return $this->speed;
}
protected function speedUp() {
$this->speed += 10;
}
//增加start方法,使他能够调用受保护的方法speedUp实现加速10
public static function start(){
$this->speedUp();
}
}
$car = new Car();//为什么这里会报错
Car::start();
echo $car->getSpeed();