"; if(isset($this->$property_name)){ return ($this->$property_name); }else return (null); } private function __set($proeprty, $val) { echo "直接设置私有属性的时候,自动调用__set"; $this->$proeprty = $val; } private function __isset($name) { echo "isset()函数测试私有成员时,自动调用"; return isset($this->$name); } private function __unset($name) { echo "unset()删除私有成员时自动调用"; unset($this->$name); }}$p1 = new Person();$p1->name = "xlc";$p1->sex = '男';$p1->age = 22;echo $p1->name;echo $p1->sex;echo $p1->age;isset($p1->name);unset($p1->name);?>