Chapter 42. Zend_Reflection

Table of Contents

42.1. Introduction
42.2. Zend_Reflection Examples
42.3. Zend_Reflection Reference
42.3.1. Zend_Reflection_Docblock
42.3.2. Zend_Reflection_Docblock_Tag
42.3.3. Zend_Reflection_Docblock_Tag_Param
42.3.4. Zend_Reflection_Docblock_Tag_Return
42.3.5. Zend_Reflection_File
42.3.6. Zend_Reflection_Class
42.3.7. Zend_Reflection_Extension
42.3.8. Zend_Reflection_Function
42.3.9. Zend_Reflection_Method
42.3.10. Zend_Reflection_Parameter
42.3.11. Zend_Reflection_Property

42.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.