Classkit İşlevleri
PHP Manual

classkit_method_rename

(PECL classkit >= 0.1)

classkit_method_renameDynamically changes the name of the given method

Açıklama

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

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

Uyarı

Bu işlev DENEYSELDİR. Bu işlevin davranışı, ismi ve belgeleri PHP'nin sonraki sürümlerinde hiçbir duyuru yapılmaksızın değiştirilebilir. Bu riski göze alamayacaksanız bu işlevi kullanmayın.

Değiştirgeler

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

Dönen Değerler

Başarı durumunda TRUE, aksi takdirde FALSE döndürür.

Örnekler

Örnek 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();
?>

Yukarıdaki örneğin çıktısı:

foo!

Ayrıca Bakınız


Classkit İşlevleri
PHP Manual