亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

類中屬性重載技術(shù)

オリジナル 2019-07-03 16:42:01 284
サマリー:<?php const IS_ISSET = true; const IS_SET = true; const IS_GET = true; const IS_UNSET = false; class Visit{ protected $data&n
<?php
const IS_ISSET = true;
const IS_SET = true;
const IS_GET = true;
const IS_UNSET = 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();
if(isset($visit->table)){
	echo $visit->table,'<br>';
}else{
	$visit->table = 'table_staff';
}

echo $visit->table,'<br>';
$visit->table = 'table_foots';

echo $visit->table;
unset($visit->table);
echo $visit->table;


添削の先生:查無此人添削時間:2019-07-04 13:20:05
先生のまとめ:完成的不錯?;A(chǔ)上php已經(jīng)入門了,以后多練習(xí)實戰(zhàn)項目。繼續(xù)加油。

手記を発表する

人気のある見出し語