method_exists 检查类的方法是否存在 &reftitle.description; boolmethod_exists objectstringobject_or_class stringmethod 检查类的方法是否存在于指定的 object_or_class 中。 &reftitle.parameters; object_or_class 对象示例或者类名 method 方法名 &reftitle.returnvalues; 如果 method 所指的方法在 object_or_class 所指的对象类中已定义,则返回 &true;,否则返回 &false;。 &reftitle.changelog; &Version; &Description; 7.4.0 针对继承的私有方法的类检查现在返回 &false;。 &reftitle.examples; <function>method_exists</function> 示例 ]]> &example.outputs; 静态 <function>method_exists</function> 示例 ]]> &example.outputs; &reftitle.notes; ¬e.uses-autoload; method_exists 函数无法检测使用 __call 魔术方法访问的方法。 &reftitle.seealso; function_exists is_callable class_exists