国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

arrayAccess的接口使用

2019-11-15 02:05:07
字體:
來源:轉載
供稿:網友
arrayaccess的接口使用
<?php    //get the methods instance of ArrayAccess    //get the PRoperties instance of ArrayAccess    $reflection = new ReflectionClass('ArrayAccess');    //var_dump($reflection->getMethods());    //var_dump($reflection->getProperties());        class dbTypes implements ArrayAccess{        private $dbtypes = array();                //判定是否存在        public function offsetExists($offset){            return isset($this->dbtypes[$offset]) ? true : false;        }        //獲取一個值        public function offsetGet($offset){            if($this->offsetExists($offset)){                return $this->dbtypes[$offset];            }else{                return null;            }        }        //設置一個值        public function offsetSet($offset,$value){                $this->dbtypes[$offset] = $value;        }        //刪除一個值        public function offsetUnset($offset){            unset($this->dbtypes[$offset]);        }    }        $types = new dbTypes();    echo $types['nosql'];                


上一篇:命名空間

下一篇:異常處理

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 仙游县| 长垣县| 新建县| 恩施市| 宾川县| 甘德县| 浑源县| 临西县| 卫辉市| 德江县| 东城区| 台中县| 扬中市| 海城市| 兴化市| 普兰县| 威远县| 始兴县| 哈尔滨市| 琼海市| 安化县| 沙河市| 四会市| 余江县| 新营市| 安新县| 三门县| 当阳市| 宝丰县| 浦江县| 新宁县| 田阳县| 于田县| 启东市| 拜泉县| 麻江县| 灵武市| 灵石县| 建阳市| 神农架林区| 瑞安市|