O'Reilly logo

Pro PHP: Patterns, Frameworks, Testing and More by Kevin McArthur

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

CHAPTER 7Reflection API

Reflection is one of the most powerful and perhaps one of the most underused features of the PHP language. If you're tasked with building complex, extensible applications, it's well worth your time to understand this powerful feature. Reflection can facilitate otherwise tedious and complicated tasks, such as autoloading plug-ins, automating documentation, and even extending the PHP language itself.

How can one feature offer such a wide array of capabilities? PHP's reflection API consists of a series of classes that allow you to access program metadata and interact with associated code comments. This gives you the ability to determine, for example, what methods a class implements. With this capability, you can create applications ...

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