Reflection API

Originally introduced in PHP 5, the Reflection API allows a PHP program to introspect code structures at runtime. Valid use cases for this examination of classes and methods, for instance, include object-relational mappers and test double libraries. Not least because of performance reasons, the usage of the Reflection API should be kept to a minimum for code that is used in production.

For PHP 7, the Reflection API has been extended to support the introspection of scalar type declarations, return type declarations, and generator functions (generators).