>>> 注意对魔术方法的使用
1 public function __set($name, $value) 2 { 3 if($name=='xxx'){ 4 return false; // 不允许修改某个属性 5 } 6 } 7 8 public function __get($name) 9 { 10 11 } 12 13 public function __isset($name) 14 { 15 16 } 17 18 public function __unset($name) 19 { 20 21 }
标签:__,...,name,function,PHP,public,类中 From: https://www.cnblogs.com/jieling/p/16818101.html