国产探花免费观看_亚洲丰满少妇自慰呻吟_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'];                


上一篇:命名空間

下一篇:異常處理

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 恩施市| 汝阳县| 监利县| 如东县| 班戈县| 荣昌县| 孟津县| 浪卡子县| 临城县| 拜泉县| 泰顺县| 浮梁县| 寿宁县| 广平县| 神农架林区| 财经| 广南县| 怀宁县| 天祝| 大悟县| 买车| 慈溪市| 金阳县| 宝山区| 通海县| 石柱| 来凤县| 桂平市| 波密县| 新兴县| 渭南市| 安多县| 上思县| 三明市| 荣成市| 临沂市| 玛多县| 东山县| 隆子县| 天长市| 潮州市|