Page 1 of 1

How can I expose the object's method and properties?

Posted: Thu Jan 25, 2007 3:28 pm
by Betty_S
Hi everyone

How can I expose the object's method and properties?
Is there a php command or keyword which expose the object's method and properties?
For example: print_r arr[0]; will print on the screen all of the array (the index or keys and the content). I'm look for somting simler that prints on the screen all of the object's method and properties.
So, who can I print all of the object's 'tree' of functions and variables?

Thanks

Posted: Thu Jan 25, 2007 3:33 pm
by feyd
If you are using PHP 4, there's nothing. If you are using PHP 5, there's reflection. http://php.net/language.oop5.reflection

Posted: Fri Jan 26, 2007 12:39 am
by volka
in php4 you can use get_class_vars and get_object_vars. It's not as powerful as reflection but it might be sufficient.