Use method_exists instead of function_exists