in php, how can I describe an object’s properties and methods? – Education Career Blog

Possible Duplicate:
print_r to get object methods in PHP?

How can I show what all the objects’ methods and properties are?

That is, including the property’s values?

,

To discover what the properties and the methods of an object are you can use ReflectionClass.

,

See get_class_methods() and get_class_vars().

Also worth nothing that PHP’s documentation is pretty good and generally a good place to ask first.

Edit: Of course, asking here seems to have its benefits as well. I never knew about the ReflectionClass Davide brought up 🙂

Leave a Comment