php8.5
Home/ Manual/ runkit7 / functions/ runkit7_function_copy

runkit7_function_copy

PHP function Edit on GitHub ✎

(PECL runkit7 >= Unknown)

Copy a function to a new function name

Description

runkit7_function_copy(string $source_name, string $target_name): bool

Parameters

source_name

Name of the existing function

target_name

Name of the new function to copy the definition to

Return Values

Success

Examples

A runkit7_function_copy() example

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

The above example will output:

output
In a function
In a function

See Also

Source: reference/runkit7/functions/runkit7-function-copy.xml · from the official PHP manual (php/doc-en)