Categories
PHP

Reflection API in PHP

The reflection API works in a similar way of Python’s dir() function. The API provides a rich set of classes to reverse engineer classes, methods, parameters and functions.

Suppose, we want to explore and reverse engineer a class, then use the following code:

For example:

Outputs:

Cool, isn’t it? I loved it ! Thanks to Hasin Hayder for referring me to this API.

Read more at: http://www.php.net/language.oop5.reflection 😉