Reflection

Reflection is a highly important concept every developer should be wary about. It denotes the ability of a program to inspect itself during runtime, thus allowing easy reverse-engineering of classes, interfaces, functions, methods, and extensions.

We can get a quick taste of the PHP reflection capabilities right from the console. The PHP CLI supports several reflection-based commands:

  • --rf <function name>: This shows information about a function
  • --rc <class name>: This shows information about a class
  • --re <extension name>: This shows information about an extension
  • --rz <extension name>: This shows information about the Zend extension
  • --ri <extension name>: This shows the configuration for an extension

The following output demonstrates ...

Get Mastering PHP 7 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.