(PECL runkit7 >= Unknown)
runkit7_method_copy — Copies a method from class to another
destination_classdestination_method_namesource_classsource_method_namedestination_method_name is assumed.
例1 runkit7_method_copy() example
<?php
class Foo {
function example() {
return "foo!\n";
}
}
class Bar {
// initially, no methods
}
// copy the example() method from the Foo class to the Bar class, as baz()
runkit7_method_copy('Bar', 'baz', 'Foo', 'example');
// output copied function
echo Bar::baz();
?>上の例の出力は以下となります。
foo!