(PECL runkit >= 0.7.0)
runkit_function_redefine — Replace a function definition with a new implementation
$funcname
, string $arglist
, string $code
)Nota: Per default, solo le funzioni in userspace possono essere rimosse, rinominate o modificate. Per effettuare l'override delle funzioni interne, si deve abilitare il parametro runkit.internal_override nel file php.ini.
funcnameName of function to redefine
arglistNew list of arguments to be accepted by function
codeNew code implementation
Restituisce TRUE in caso di successo, FALSE in caso di fallimento.
Example #1 A runkit_function_redefine() example
<?php
function testme() {
echo "Original Testme Implementation\n";
}
testme();
runkit_function_redefine('testme','','echo "New Testme Implementation\n";');
testme();
?>
Il precedente esempio visualizzerĂ :
Original Testme Implementation New Testme Implementation