(PECL runkit:0.7-0.9)
runkit_function_redefine — Replace a function definition with a new implementation
Note: 預設情況下,只有用戶空間的函式可以被刪除,重命名,或者修改。要覆蓋內部函式,必須啟用全系統範圍的 php.ini 文件中的 runkit.internal_override 選項。
Name of function to redefine
New list of arguments to be accepted by function
New code implementation
如果成功則回傳 TRUE,失敗則回傳 FALSE。
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();
?>
上例將輸出:
Original Testme Implementation New Testme Implementation