spondishy Posted September 2, 2009 Share Posted September 2, 2009 Hi, Just playing around with php at the moment and just wondered if there was a way of getting a list of all methods of an object that is being returned by an api I'm using. For example, the api returns an object of type x. What methods etc does x have. Thanks Link to comment https://forums.phpfreaks.com/topic/172836-get-properties-and-methods-from-an-object/ Share on other sites More sharing options...
trq Posted September 2, 2009 Share Posted September 2, 2009 Take a look at reflection. Link to comment https://forums.phpfreaks.com/topic/172836-get-properties-and-methods-from-an-object/#findComment-910925 Share on other sites More sharing options...
JonnoTheDev Posted September 2, 2009 Share Posted September 2, 2009 Reflection class or simple method: $methods = get_class_methods(get_class($x)); print_r($methods); Link to comment https://forums.phpfreaks.com/topic/172836-get-properties-and-methods-from-an-object/#findComment-911036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.