Taking Advantage of the New Reflection API in PHP5
Discover how to use the Reflection API to extract information about PHP classes and execute class methods.
by Octavia Andreea Anghel
November 19, 2007
f you haven't yet upgraded from PHP4 to PHP5, this article will give you a serious reason to do so: PHP5 now supports reflection through the Reflection API, which you can use to examine variables, interfaces, functions, methods, parameters, classes—and more. The Reflection API is generous; it offers a large number of classes and methods that you can use to accomplish reflection tasks.
To get a sense of the the theoretical aspect of the Reflection API, you'll see a brief description of the Reflection API classes and methods, illustrated by short examples. Later, you'll see two real-world application examples in PHP that make run-time decisions about which methods to call and auto-generate well-formatted HTML documentation for your PHP classes.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!