Forum und email
runkit_method_remove

runkit_method_remove

(PECL)

runkit_method_remove -- Dynamically removes the given method

Popis

bool runkit_method_remove ( string classname, string methodname )

Poznámka: Tuto funkci nelze použít k manipulaci s aktuálně běžící metodou (nebo metodou v řetězu).

Varování

Tato funkce je EXPERIMENTÁLNÍ. Chování této funkce, její název a všechno ostatní, co je zde zdokumentováno, se v budoucích verzích PHP může BEZ OHLÁŠENÍ změnit. Berte to v úvahu a používejte tuto funkci na vlastní nebezpečí.

Seznam parametrů

classname

The class in which to remove the method

methodname

The name of the method to remove

Návratové hodnoty

Vrací TRUE při úspěchu, FALSE při selhání.

Příklady

Příklad 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'));

?>

Výše uvedený příklad vypíše:

bar