runkit_method_remove
(PECL runkit >= 0.7.0)
runkit_method_remove — 指定したメソッドを動的に削除する
説明
runkit_method_remove
( string
$classname
, string $methodname
) : bool注意: この関数は、 現在実行中(もしくはチェーンド)のメソッドを操作することはできません。
パラメータ
-
classname -
メソッドを削除するクラス。
-
methodname -
削除するメソッドの名前。
返り値
成功した場合に TRUE を、失敗した場合に FALSE を返します。
例
例1 runkit_method_remove() の例
<?php
class Example {
function foo() {
return "foo!\n";
}
function bar() {
return "bar!\n";
}
}
// 'foo' メソッドを削除する
runkit_method_remove(
'Example',
'foo'
);
echo implode(' ', get_class_methods('Example'));
?>
上の例の出力は以下となります。
bar
参考
- runkit_method_add() - Dynamically adds a new method to a given class
- runkit_method_copy() - あるクラスのメソッドを別のクラスにコピーする
- runkit_method_redefine() - Dynamically changes the code of the given method
- runkit_method_rename() - 指定したメソッドの名前を動的に変更する
- runkit_function_remove() - 関数の定義を削除する