簡體   English   中英

如何重命名或覆蓋php函數?

[英]How to rename or overwrite php function?

如何使用Runkit在php中重新定義函數?

$helloWorld = 'echo "Call require_once";';
runkit_function_redefine('require_once', '$word', $helloWorld);
require_once("abc.php");

我在php.ini中設置

runkit.internal_override=1

當我跑步時,它顯示:

Warning: runkit_function_redefine() [function.runkit-function-redefine]: require_once() not found in hhd_debug.php on line 2

Warning: require_once(abc.php) [function.require-once]: failed to open stream: No such file or directory in hhd_debug.php on line 3

Fatal error: require_once() [function.require]: Failed opening required 'abc.php' (include_path='.;xampp\php\PEAR') in hhd_debug.php on line 3

我該如何解決? 請幫我!

我猜這是行不通的,因為require_once是一種語言構造,而不是一個函數。
我不知道是否還有其他方法可以覆蓋它,我想不會。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM