I have an unknown object in php page.
How can I print/echo it, so I can see what properties/values do it have?
What about functions? Is there any way to know what functions an object have?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
or
These are the same things you use for arrays too.
These will show protected and private properties of objects with PHP 5. Static class members will not be shown according to the manual.
If you want to know the member methods you can use get_class_methods():
Related stuff:
get_object_vars()
get_class_vars()
get_class() <– for the name of the instance