略0略ing
2017-08-28 17:10
<?php
class Car {
public $speed = 0;
public static function speedUp(){
$this->speed += 10;
}
}
echo Car::speedUp();
?>各位大神救救这个代码吧,感谢~
class Car {
public static $speed = 0;
public static function speedUp(){
return self::$speed += 10;
}
}
echo Car::speedUp();
,静态方法不能用this-> 静态调用用双冒号
::两个双引号什么意思啊?
PHP进阶篇
181979 学习 · 2668 问题
相似问题