function toShow()
{
function show()
{
;
}
show();
}
会导致:
:(
Cannot redeclare CommonObjectshow() (previously declared in
C:wampwwwCCDCCommonObjectWorkFlow.class.php:163)
好像是只要在一次请求中,有多次调用toShow方法就会出现这种情况。是thinkphp3.2版本。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
php不能(在同一命名空间里)重复定义同名函数,和tp无关。
想做函数里的“内部”函数,用匿名函数吧。
可以考虑把函数封装在数组内.