Possible Duplicate:
PHP: The Reflection API – Great Addition To PHP With Little Use
Finding documentation is one problem, but the quality of documentation is another, equally important, problem. Most developers know the value of accurately commented code, but when i am in the middle of coding, the meaning of your code always seems crystal clear, so comments appear superfluous. Besides, there’s always the ultimate excuse for the absence of internal documentation—i want to keep file size small to reduce download time.
This is often the situation with internal documentation, but external documentation fares no better. It doesn’t make sense to write it as i go because things always change, but, by the time i’ve finished coding, documentation is the furthest thing from my mind.
However: I searched in google and I found a solution called Reflection Classes Could any one describe it briefly plz ?
Excerpt from the book Object-oriented PHP: concepts, techniques, and code
By Peter Lavin:
This group of classes was created for the express purpose of introspecting other classes. These classes
make it possible to examine the properties of other classes by retrieving metadata
about classes; you can even use them to examine the reflection classes themselves.
Reflection provides information about the modifiers of a class or interface—whether that class is final or static, for example.
It can also reveal all the methods and data members of a class and all the modifiers applied to them.
Parameters passed to methods can also be introspected and the names of variables exposed. Through reflection it is possible to automate the documentation of built-in classes or user-defined
classes.
It turns out that the central repository of information about classes was right in front of us all the time. PHP can tell us all about itself through the mirror of the reflection classes.
The reflection group of classes or Application Programming Interface (API) is made up of a number of different classes and one
interface, shown here:
Look at this list, there is actually no class ancestor common to all reflection classes. On the other hand, the Reflector interface is shared by all classes except Reflection and ReflectionException.
ReflectionMethod extendsReflectionFunction, ReflectionObjectextendsReflectionClass, andReflectionExceptionextends Exception.ReflectionObjectshares all the methods of ReflectionClass; the only difference between these classes is that ReflectionObject takes a class instance rather than a class name as a parameter—using an instance, you can introspect a class without knowing anything about it, even its name.