With method_exists, it checks all methods, including the parent class.
Example:
class Toot {
function Good() {}
}
class Tootsie extends Toot {
function Bad() {}
}
function testMethodExists() {
// true
var_dump(method_exists('Toot', 'Good'));
// false
var_dump(method_exists('Toot', 'Bad'));
// true
var_dump(method_exists('Tootsie', 'Good'));
// true
var_dump(method_exists('Tootsie', 'Bad'));
}
How can I check that the method only exists on the current class and not parent class (ie. Tootsie)?