php -- 反射ReflectionClass

反射类:ReflectionClass

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

ReflectionClass::export(类名); 

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

$rc = new ReflectionClass(类名);

$rc->getConstants();

返回常量数组

$rc = new ReflectionClass(类名);

$rc->getMethods();

返回方法数组

$rc = new ReflectionClass(类名);

$rc->getProperties();

返回属性数组

原文地址:https://www.cnblogs.com/hf8051/p/4673778.html