PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ctype> <Classkit Funktionen
Last updated: Fri, 11 Apr 2008

view this page in

classkit_method_rename

(PECL classkit:0.1-0.4 runkit:0.7-0.9)

classkit_method_rename — Dynamically changes the name of the given method

Beschreibung

bool classkit_method_rename ( string $classname , string $methodname , string $newname )

Hinweis: This function cannot be used to manipulate the currently running (or chained) method.

Warnung

Diese Funktion ist EXPERIMENTELL. Das Verhalten, der Funktionsname und alles Andere was hier dokumentiert ist, kann sich in zukünftigen PHP-Versionen ohne Ankündigung ändern. Seien Sie gewarnt und verwenden Sie diese Funktion auf eigenes Risiko.

Parameter-Liste

classname

The class in which to rename the method

methodname

The name of the method to rename

newname

The new name to give to the renamed method

Rückgabewerte

Gibt bei Erfolg TRUE zurück, im Fehlerfall FALSE.

Beispiele

Beispiel #1 classkit_method_rename() example

<?php
class Example {
    function 
foo() {
        return 
"foo!\n";
    }
}

// Rename the 'foo' method to 'bar'
classkit_method_rename(
    
'Example',
    
'foo',
    
'bar'
);

// output renamed function
echo Example::bar();
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

foo!



add a note add a note User Contributed Notes
classkit_method_rename
There are no user contributed notes for this page.

ctype> <Classkit Funktionen
Last updated: Fri, 11 Apr 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites