I\'m building a unit testing framework for PHP and I was curious if there is a way to get a list of an objects methods which excludes the parent class\'s methods. So g
You can use get_class_methods()
without instantiating the class:
$class_name - The class name or an object instance.
So the following would work:
$bar_methods = array_diff(get_class_methods('Bar'), get_class_methods('Foo'));
Assuming there aren't repeated methods in the parent class. Still, Lukman's answer does a better job. =)