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

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

,PHP Reflection API詳解

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

   這篇文章主要介紹了PHP Reflection API詳解,本文講解了Reflection類、ReflectionException類、ReflectionFunction類、ReflectionParameter類、ReflectionClass類、ReflectionMethod類等內容,需要的朋友可以參考下

  PHP Reflection API是PHP5才有的新功能,它是用來導出或提取出關于類、方法、屬性、參數等的詳細信息,包括注釋。

  PHP Reflection API有:

  ?

1 2 3 4 5 6 7 8 9 10 class Reflection { } interface Reflector { } class ReflectionException extends Exception { } class ReflectionFunction implements Reflector { } class ReflectionParameter implements Reflector { } class ReflectionMethod extends ReflectionFunction { } class ReflectionClass implements Reflector { } class ReflectionObject extends ReflectionClass { } class ReflectionProperty implements Reflector { } class ReflectionExtension implements Reflector { }

  具體API說明:

  ①Reflection類

  ?

1 2 3 4 5 6 7 8 9 <?php class Reflection { public static mixed export(Reflector r [,bool return]) //導出一個類或方法的詳細信息 public static array getModifierNames(int modifiers) //取得修飾符的名字 }
蝦滾網[www.aikan.tv/special/xiagundianyingwang/]
?>

  ②ReflectionException類

  該類繼承標準類,沒特殊方法和屬性。

  ③ReflectionFunction類

  ?

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 32 33 34 35 36 37 38 <?php class ReflectionFunction implements Reflector { final private __clone() public object __construct(string name) public string __toString() public static string export() //導出該函數的詳細信息 public string getName() //取得函數名 public bool isInternal() //測試是否為系統內部函數 public bool isUserDefined() //測試是否為用戶自定義函數 public string getFileName() //取得文件名,包括路徑名 public int getStartLine() //取得定義函數的起始行 public int getEndLine() //取得定義函數的結束行 public string getDocComment() //取得函數的注釋 public array getStaticVariables() //取得靜態變量 public mixed invoke(mixed* args) //調用該函數,通過參數列表傳參數 public mixed invokeArgs(array args) //調用該函數,通過數組傳參數 public bool returnsReference() //測試該函數是否返回引用 public ReflectionParameter[] getParameters() //取得該方法所需的參數,返回值為對象數組 public int getNumberOfParameters() //取得該方法所需的參數個數 public int getNumberOfRequiredParameters() //取得該方法所需的參數個數 } ?>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 湄潭县| 汉川市| 通榆县| 三亚市| 同德县| 旬邑县| 大兴区| 应城市| 明水县| 阳泉市| 伊通| 莒南县| 天水市| 东乡族自治县| 广水市| 友谊县| 双峰县| 外汇| 新民市| 铜山县| 石泉县| 平安县| 镇康县| 呼玛县| 大连市| 乐至县| 辽宁省| 皋兰县| 伊春市| 田阳县| 衡水市| 竹溪县| 桃园市| 太仓市| 镇江市| 渝北区| 陵水| 古丈县| 龙胜| 遂川县| 萨嘎县|