If I call $object->showSomething() and the showSomething method doesn\'t exist I get a fata error. That\'s OK.
$object->showSomething()
showSomething
But I have a show()
show()
You can use the function method_exists(). Example:
class X { public function bar(){ echo "OK"; } } $x = new X(); if(method_exists($x, 'bar')) echo 'call bar()'; else echo 'call other func';