21,886
社区成员
发帖
与我相关
我的任务
分享
class JSONSerial {
protected $m_datas = null;
public function __set($name, $value) {
$this->m_datas[$name] = $value;
}
public function __get($name) {
return isset($this->m_datas[$name]) ? $this->m_datas[$name] : null;
}
}
$serial = new JSONSerial();
$serial->hot_type = 2;
$hot_type = isset($serial->hot_type) ? $serial->hot_type : 0;
echo $hot_type . "<br>";
$hot_type = $serial->hot_type != null ? $serial->hot_type : 0;
echo $hot_type . "<br>";