php中的反射api由一系列可以分析属性,方法和类的内置类组成。利用这些反射API中的类,可以在运行时访问对象。函数和脚本中的扩展的信息。

主要用途:

            1) 由于反射API能够输出很多类,方法等相关的内部信息,所以很方便当做类测试的工具;

             2)根据命名规则创建一个调用模板类中方法的框架

主要的Api:

Reflection {}
Reflector {}
ReflectionFunctionAbstract implements Reflector {}
ReflectionClass implements Reflector {}
ReflectionExtension implements Reflector {}
ReflectionFunction extends ReflectionFunctionAbstract implements Reflector {}
ReflectionMethod extends ReflectionFunctionAbstract implements Reflector {}
ReflectionObject extends ReflectionClass implements Reflector {}
ReflectionParameter implements Reflector {}
ReflectionProperty implements Reflector {}
ReflectionException extends Exception {}
 

相关文章:

  • 2021-12-06
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2021-08-15
  • 2021-12-30
猜你喜欢
  • 2021-07-01
  • 2021-04-23
  • 2021-09-17
  • 2022-12-23
  • 2021-10-01
相关资源
相似解决方案