为什么是9呢?不解
<?php
class test{
protected $a=9,$b=2,$c;
public $d;
function __set($n,$v){
return $this->$n=$v+2;
}
function __get($name){
return $this->$name+2;
}
}
$a=new test();
$a->b=5;
echo $a->b;
<?php
class test{
protected $a=9,$b=2,$c;
public $d;
function __set($n,$v){
return $this->$n=$v+2;
}
function __get($name){
return $this->$name+2;
}
}
$a=new test();
$a->b=5;
echo $a->b;
2016-10-22
举报