runkit7_function_redefine
(PECL runkit7 >= Unknown)
Replace a function definition with a new implementation
Description
Internal-override
Parameters
function_nameName of function to redefine
argument_listNew list of arguments to be accepted by function
codeNew code implementation
closureA
closurethat defines the function.return_by_referenceWhether the function should return by reference.
doc_commentThe doc comment of the function.
return_typeThe return type of the function.
is_strictWhether the function behaves as if it was declared in a file with
strict_types=1
Return Values
Success
Examples
A runkit7_function_redefine() example
<?php
function testme() {
echo "Original Testme Implementation\n";
}
testme();
runkit7_function_redefine('testme','','echo "New Testme Implementation\n";');
testme();
?>The above example will output:
Original Testme Implementation
New Testme Implementation