Detailed introduction of PHP Reflection API function
This article mainly explains the "detailed introduction of the function of PHP Reflection API". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the detailed introduction of PHP Reflection API function".
PHP Reflection API is a new feature of PHP5. It is used to export or extract detailed information about classes, methods, properties, parameters, etc., including comments.
PHP Reflection API has:
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 {}
Specific API description:
① Reflection class
② ReflectionException class
This class inherits the standard class and has no special methods or properties.
③ ReflectionFunction class
④ ReflectionParameter class:
⑤ ReflectionClass class:
⑥ ReflectionMethod class:
⑦ ReflectionProperty class:
⑧ ReflectionExtension class
Examples of use: