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

首頁 > 網站 > 建站經驗 > 正文

PHP 反射(Reflection),使用實例

2019-11-02 15:37:56
字體:
來源:轉載
供稿:網友

   這篇文章主要介紹了PHP 反射(Reflection)使用實例,本文講解了ReflectionClass、ReflectionExtension、 ReflectionFunction、ReflectionMethod、ReflectionObject、ReflectionParameter等類的使用實例,需要的朋友可以參考下

  PHP Reflection是用于獲取類、擴展、方法、函數、對象、參數、屬性的詳細信息。

  ReflectionClass類獲取類相關信息,如獲取屬性、方法、文檔注釋等。

  ?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
多瑙影院[www.aikan.tv/special/duonaoyingyuan/]
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 <?php   class Person { /** * For the sake of demonstration, we"re setting this private */ private $_allowDynamicAttributes = false;   /** type=primary_autoincrement */ protected $id = 0;   /** type=varchar length=255 null */ protected $name;   /** type=text null */ protected $biography;   public function getId() { return $this->id; } public function setId($v) { $this->id = $v; } public function getName() { return $this->name; } public function setName($v) { $this->name = $v; } public function getBiography() { return $this->biography; } public function setBiography($v) { $this->biography = $v; } }   //導出類 ReflectionClass::export('Person');   $r = new ReflectionClass('Person');   //獲取所有屬性 print_r($r->getProperties());   /** * 獲取指定屬性 * ReflectionProperty::IS_STATIC * ReflectionProperty::IS_PUBLIC * ReflectionProperty::IS_PROTECTED * ReflectionProperty::IS_PRIVATE */ print_r($r->getProperties(ReflectionProperty::IS_PRIVATE));   //獲取注釋 print_r($r->getProperty('id')->getDocComment());   //獲取方法 print_r($r->getMethods());
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 长宁县| 察哈| 正定县| 河西区| 赫章县| 大英县| 公主岭市| 长治县| 延川县| 金华市| 视频| 古交市| 钦州市| 长乐市| 北海市| 兴文县| 桓台县| 宁国市| 阳新县| 金华市| 林芝县| 社旗县| 离岛区| 广丰县| 榆社县| 瑞昌市| 景谷| 太仓市| 濉溪县| 临颍县| 济源市| 且末县| 双城市| 肇源县| 临安市| 德惠市| 榕江县| 凤翔县| 星座| 通河县| 罗甸县|