If you want to check if a function or method really exists, you can use is_callableit before calling call_user_func. You can wrap all this with a function for easy reuse:
function call_uf($fn) {
if(is_callable($fn)) {
return call_user_func($fn);
} else {
throw new Exception("$fn is not callable");
}
}
, PHP . , , PHP5, PHP . , , :
PHP , . ErrorException.