swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 788 forks source link

公共函数加任何一个函数报错,程序启动不了 #643

Closed caige-phper closed 5 years ago

caige-phper commented 5 years ago

在app\Helper\Functions.php中加入任何一个函数,程序启动报错

PHP Fatal error: Cannot redeclare test() (previously declared in /home/wwwroot/swoft2/app/Helper/Functions.php:7)

panyongwei commented 5 years ago

在app\Helper\Functions.php中加入任何一个函数,程序启动报错

PHP Fatal error: Cannot redeclare test() (previously declared in /home/wwwroot/swoft2/app/Helper/Functions.php:7)

使用function_exists判断函数是否已经存在,不存在才定义就好了