method_exists () in php?
<?php
classA
{
publice function foo()
}
echo “foo”;
}
publice function bar()
{
if(method_exists($this,’foo’))
}
else
{
echo “method does not”;
}
}
}
$obj=newA;
$obj->barb;
?>
Output
method exists