abstract:data
const IS_ISSET=true;
const IS_GET=true;
const IS_SET=true;
const IS_UNSETA=false;
class Visit
{
protected $data=[];
public function __isset($name)
{
return IS_ISSET && isset($this->data[$name]);
}
public function __get($name)
{
return IS_GET?$this->data[$name]:'非法访问';
}
public function __set($name,$value)
{
IS_SET?$this->data[$name]=$value:'禁止赋值';
}
public function __unset($name)
{
if(IS_UNSET)
unset($this->data[$name]);
}else{
echo '禁止销毁';
}
}
}
$visit= new Visit();
$visit->table='员工表';
require 'public/class.php';
class Web
{
public function __call($name,$arguments)
{
return '方法:'.$name.'
参数类列表'.var_export($arguments,true);
return call_user_func_array([(new Site),'show'],$arguments);
}
public static function add($arguments)
{
return call_user_func_array(['Site','add'],$arguments);
}
}
$web=new Web();
echo $web->show('php中文网','海量资源'),'
';
echo Web::add(30,50);
Correcting teacher:查无此人Correction time:2019-06-06 09:18:41
Teacher's summary:完成的不错,下次把代码缩进对齐,继续加油