January 2, 2012

"var_dump" functions

Question by Joseph the Dreamer

by the function name itself, var_dump() dumps everything about a provided parameter EXCEPT the functions of an object.

is there a way of dumping out these functions?

Answer by zerkms

You cannot get the object’s methods, but you can get the class methods:

var_dump(get_class_methods('classname'));

or

var_dump(get_class_methods(get_class($object)));

Answer by Starx

You can use ReflectionClass API too

An Example:

$cls = new ReflectionClass("classname");
var_dump($cls -> getMethods());

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!