(PECL runkit7 >= Unknown)
runkit7_function_redefine — Replace a function definition with a new implementation
$function_name,$argument_list,$code,$return_by_reference = null,$doc_comment = null,$return_type = ?,$is_strict = ?$function_name,$closure,$doc_comment = null,$return_type = ?,$is_strict = ?Note: By default, only userspace functions may be removed, renamed, or modified. In order to override internal functions, you must enable the
runkit.internal_overridesetting in php.ini.
function_nameargument_listcodeclosurereturn_by_referencedoc_commentreturn_typeis_strictstrict_types=1
Example #1 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