O'Reilly logo

Mastering PHP 7 by Branko Ajzele

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required