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(); ?>
|
Результат выполнения данного примера:
Смотрите также
| classkit_method_add() | | classkit_method_redefine() | | classkit_method_remove() | | classkit_method_rename() |
|