(PECL runkit >= 0.7.0)
runkit_method_remove — Dynamically removes the given method
$classname
, string $methodname
) : boolNota: Esta função não pode ser utilizada para manipular um método ativo (ou encadeado) method.
classnameThe class in which to remove the method
methodnameThe name of the method to remove
Retorna TRUE em caso de sucesso ou FALSE em caso de falha.
Exemplo #1 runkit_method_remove() example
<?php
class Example {
function foo() {
return "foo!\n";
}
function bar() {
return "bar!\n";
}
}
// Remove the 'foo' method
runkit_method_remove(
'Example',
'foo'
);
echo implode(' ', get_class_methods('Example'));
?>
O exemplo acima irá imprimir:
bar