Cannot redeclare class xx in 解决方案

写PHP代码的时候碰到这样的问题

Cannot redeclare class Yaoyuan in

类名重复定义了。
解决思路:在重复定义类名的地方。加上if判断代码如下

if (!class_exists('Yaoyuan')){
    require_once(PATH_site.'c/lib/Yaoyuan.php');
}

原创文章,作者:星辰,如若转载,请注明出处:http://www.z88j.com/355.html

(12)
打赏 微信扫一扫 微信扫一扫
上一篇 2021年7月26日 下午4:57
下一篇 2021年8月10日 下午3:10

相关推荐

发表回复

登录后才能评论

Warning: error_log(/www/wwwroot/www.z88j.com/wp-content/plugins/spider-analyser/#log/log-1906.txt): failed to open stream: No such file or directory in /www/wwwroot/www.z88j.com/wp-content/plugins/spider-analyser/spider.class.php on line 2900