Sep
17
2010
classkit_method_copy()

classkit_method_copy

(PECL)

classkit_method_copy -- Copies a method from class to another

Описание

bool classkit_method_copy ( string dClass, string dMethod, string sClass [, string sMethod] )

Внимание

Эта функция является ЭКСПЕРИМЕНТАЛЬНОЙ. Поведение этой функции, ее имя и относящаяся к ней документация могут измениться в последующих версиях PHP без уведомления. Используйте эту функцию на свой страх и риск.

Список параметров

dClass

Destination class for copied method

dMethod

Destination method name

sClass

Source class of the method to copy

sMethod

Name of the method to copy from the source class. If this parameter is omitted, the value of dMethod is assumed.

Возвращаемые значения

Возвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки.

Примеры


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

class 
Bar {
    
// initially, no methods
}

// copy the () method from the Foo class to the Bar class, as baz()
classkit_method_copy('Bar''baz''Foo''');

// output copied function
echo Bar::baz();
?>

Результат выполнения данного примера:

foo!

Смотрите также

classkit_method_add()
classkit_method_redefine()
classkit_method_remove()
classkit_method_rename()

 
 
 
Комментарии
Добавить новый Поиск
Оставить комментарий
Имя:
Email:
 
Веб-сайт:
Тема:
UBB-Код:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Пожалуйста, введите проверочный код, который Вы видите на картинке.
Powered by !JoomlaComment 3.26

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 

Кто онлайн

Сейчас 14 гостей онлайн