结果为什么是2而不是5?
class a{
public $age=2;
public function __constrator(){
$this->age=$age+3;
}
}
$k=new a();
echo $k->age;
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
笑死我了
__constrator变成__construct以及$this->age=$this->age+3;一下这条少了一个$this->