关于属性声明三种开头字段
class QC{ public $name = '汽车'; protected $color = '红色'; //定义私有属性 private $price = '100000'; public function get(){ return $this->color; return $this->price; } } $car = new QC(); echo $car->get(); 左后输出get()只能处处颜色,是什么个意思,100000呢?
class QC{ public $name = '汽车'; protected $color = '红色'; //定义私有属性 private $price = '100000'; public function get(){ return $this->color; return $this->price; } } $car = new QC(); echo $car->get(); 左后输出get()只能处处颜色,是什么个意思,100000呢?
2017-09-20
举报