php -- 反射ReflectionClass

反射类:ReflectionClass

 

反射就是将其他类的结构给反应出来,从而可以对类的结构进行了解便于对类的使用。

 

ReflectionClass::export(类名); 

返回结果为三个数组:常量数组,方法数组,属性数组

 

$rc = new ReflectionClass(类名);

$rc->getConstants();

返回常量数组

 

$rc = new ReflectionClass(类名);

$rc->getMethods();

返回方法数组

 

$rc = new ReflectionClass(类名);

$rc->getProperties();

返回属性数组

 

posted @ 2015-07-24 16:00  goodup  阅读(157)  评论(0编辑  收藏  举报

如有不对之处,欢迎指出,一起成长