PHP - print all properties of an object

后端 未结 6 1580
野的像风
野的像风 2020-12-08 03:36

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 kno

6条回答
  •  执笔经年
    2020-12-08 04:14

    for knowing the object properties var_dump(object) is the best way. It will show all public, private and protected properties associated with it without knowing the class name.

    But in case of methods, you need to know the class name else i think it's difficult to get all associated methods of the object.

提交回复
热议问题