(PECL runkit7 >= Unknown)
runkit7_method_remove — Dynamically removes the given method
$classname
, string $methodname
) : boolHinweis: Diese Funktion kann nicht genutzt werden, um die aktuell ausgeführte (oder verkette) Methode zu manipulieren.
classnameThe class in which to remove the method
methodnameThe name of the method to remove
Gibt bei Erfolg TRUE zurück. Im Fehlerfall wird FALSE zurückgegeben.
Beispiel #1 runkit7_method_remove() example
<?php
class Example {
function foo() {
return "foo!\n";
}
function bar() {
return "bar!\n";
}
}
// Remove the 'foo' method
runkit7_method_remove(
'Example',
'foo'
);
echo implode(' ', get_class_methods('Example'));
?>
Das oben gezeigte Beispiel erzeugt folgende Ausgabe:
bar