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 the result of the php --rf str_replace
command:
Function [ <internal:standard> function str_replace ] { - Parameters [4] { Parameter #0 [ <required> $search ] Parameter #1 [ <required> $replace...