class Car {
public static $speed = 0;
//增加speedUp方法,使speed加10
public static function speedUp(){
self::$speed+=10;
}
}
//$car = new Car();
Car::speedUp();
echo Car::$speed;
public static $speed = 0;
//增加speedUp方法,使speed加10
public static function speedUp(){
self::$speed+=10;
}
}
//$car = new Car();
Car::speedUp();
echo Car::$speed;
2015-08-04