求大神指教以下代码的输出,为什么我得到的总是1,和2
<?php
class myClass{ private $arr = array('x'=>null,'y'=>null);

function _get($property){
if(array_key_exists($property,$this->arr)){
return $this->arr[$property];
}else{
echo "can not find key $property";
}
}

function _set($property,$value){
if(array_key_exists($property,$this->arr)){
$this->arr[$property] = $value;
}else{
echo "can not find key $property";
}
}

}$obj = new myClass();
$obj->x = 1;
echo $obj->x;
print "\n";$obj->d = 2;
echo $obj->d;
?>