Home > Q&A > body text
结果为什么是2而不是5?
class a{ public $age=2; public function __constrator(){ $this->age=$age+3; } }$k=new a();echo $k->age;
三叔2016-10-22 13:23:48
笑死我了 __constrator 变成 __construct 以及 $this->age=$this->age+3;