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
How can I expose the object's method and properties?
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
If you are using PHP 4, there's nothing. If you are using PHP 5, there's reflection. http://php.net/language.oop5.reflection
in php4 you can use get_class_vars and get_object_vars. It's not as powerful as reflection but it might be sufficient.