Chapter 43. Zend_Reflection

Table of Contents

43.1. Introduction
43.2. Zend_Reflection Examples
43.3. Zend_Reflection Reference
43.3.1. Zend_Reflection_Docblock
43.3.2. Zend_Reflection_Docblock_Tag
43.3.3. Zend_Reflection_Docblock_Tag_Param
43.3.4. Zend_Reflection_Docblock_Tag_Return
43.3.5. Zend_Reflection_File
43.3.6. Zend_Reflection_Class
43.3.7. Zend_Reflection_Extension
43.3.8. Zend_Reflection_Function
43.3.9. Zend_Reflection_Method
43.3.10. Zend_Reflection_Parameter
43.3.11. Zend_Reflection_Property

43.1. Introduction

Zend_Reflection is a drop-in extension to PHP's own Reflection API, providing several additional features:

  • Ability to retrieve return values types.

  • Ability to retrieve method and function parameter types.

  • Ability to retrieve class property types.

  • DocBlocks gain a Reflection class, allowing introspection of docblocks. This provides the ability to determine what annotation tags have been defined as well as to retrieve their values, and the ability to retrieve the short and long descriptions.

  • Files gain a Reflection class, allowing introspection of PHP files. This provides the ability to determine what functions and classes are defined in a given file, as well as to introspect them.

  • Ability to override any Reflection class with your own variant, for the entire reflection tree you create.

In general, Zend_Reflection works just like the standard Reflection API, but provides a few additional methods for retrieving artifacts not defined in the Reflection API.