In the following code I call a class with call_user_func().
call_user_func()
if(file_exists(\'controller/\' . $this->controller . \'.controller.php\')) {
You can use the PHP function method_exists():
if (method_exists('ClassName', 'method_name')) call_user_func(etc...);
or also:
if (method_exists($class_instance, 'method_name')) call_user_func(etc...);