重新定义PHP函数? [英] Redefining PHP function?
本文介绍了重新定义PHP函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我有一个函数: 如果我想重新定义这个函数,它会和重写它一样简单吗? ? : runkit提供的选项包括 If I have a function: If I wanted to redefine the function, would it be as simple as rewriting it?
Nope, that throws an error: The runkit provides options, including 这篇关于重新定义PHP函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
$ p $ function this($ a){
return $ a;
$ / code>
pre $ 函数this($ a,$ b){//新函数
返回$ a * $ b ;
}
解决方案
致命错误:无法重新声明foo()
runkit_function_rename()
和 runkit_function_redefine()
。function this($a){
return $a;
}
function this($a, $b){ //New this function
return $a * $b;
}
解决方案 Fatal error: Cannot redeclare foo()
runkit_function_rename()
and runkit_function_redefine()
.
查看全文