runkit7_function_copy

Copy a function to a new function name

説明

bool runkit7_function_copy(string $source_name, string $target_name)

パラメータ

source_name

Name of the existing function

target_name

Name of the new function to copy the definition to

戻り値

成功した場合に true を、失敗した場合に false を返します。

例1 A runkit7_function_copy example

<?php
function original() {
  echo 
"In a function\n";
}
runkit7_function_copy('original','duplicate');
original();
duplicate();
?>

上の例の出力は以下となります。

In a function
In a function

参考

  • runkit7_function_add
  • runkit7_function_redefine
  • runkit7_function_rename
  • runkit7_function_remove