So, method_exists() requires an object to see if a method exists. But I want to know if a method exists from within the same class.
method_exists()
I have a method that
You can do something like this:
class A{ public function foo(){ echo "foo"; } public function bar(){ if(method_exists($this, 'foo')){ echo "method exists"; }else{ echo "method does not exist"; } } } $obj = new A; $obj->bar();