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
継承した private メソッドに対してこの関数を実行しても、
&false; を返すようになりました。
&reftitle.examples;
method_exists の例
]]>
&example.outputs;
staticメソッドに対する method_exists の例
]]>
&example.outputs;
&reftitle.notes;
¬e.uses-autoload;
マジックメソッド __call を使ってアクセス可能なメソッドを、method_exists は検知できません。
&reftitle.seealso;
function_exists
is_callable
class_exists