Utility to print to screen class name, vars and functions?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am thinking of writing a utility that will read a class and output  
something like the example below to the screen:-

Class: User
Variable Names: $name, $age, $sex
Function Names: addUser, editUser, approveUser, activateUser, deleteUser

I would like to be able to actually select which classes to process and  
perhaps use a stylesheet to format the output. Even might look at adding  
other information such as last modified date.

It doesn't look too difficult using "get_class_vars" and "get_class_methods"  
but before I go off and do this, I wondered if any such thing already  



Re: Utility to print to screen class name, vars and functions?

Phil Latio kirjoitti:
Quoted text here. Click to load it

I'm thinking with var_dump you get the most out of a class variables,  
then combine it with get_class_methods and there you have it. A very  
nice reflection of the class.

echo 'functions: '.implode(',', get_class_methods(get_class($object)));

"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)

Site Timeline