I'm working on some legacy code and I need to get some information from an object. The price, for example. The price could be stored in a variable or it could be retrieved via a method. I don't yet know, only that it exists within the object.
I can grab an object in the code and var_dump all of the variables to have a look-see at what's available at that point in the runtime. But sometimes what I need isn't returned by
$item->price
but instead needs to be retrieved by
$item->get_price()
It seems to me it would be really helpful to be able to dump information from methods in the same way as I can dump information from variables.
So ideally I'd stick this command in the code, and it would return minimally a list of all methods that can be called on the object. Ideally, if those methods have no inputs, then it would also return their return values too.
Does such a command exist in PHP? In any language?