老吴 发表于 2024-5-21 18:08:13

PHP这个报错解决方法Non-static method xc_core::instance() should not b

今天在升级网站的时候,碰上PHP问题。 简单记录分享一下。


错误提示Strict Standards: Non-static method xc_core::instance() should not be called statically in D:\wwwroot\......\.........\index.php on line 4




根据错误文件第4行,去找一下。




找到对应的函数instance()。全局搜索一下,发现这个函数没有静态声明




function &instance()改为 static function &instance()   即可解决问题。前面加了static 声明静态。



lf2k2022 发表于 2024-5-21 23:51:37

power3 发表于 2024-5-22 08:19:40

·风来了 发表于 2024-5-22 08:19:48

ilpuyi 发表于 2024-5-22 08:26:36

caodiren 发表于 2024-5-22 08:45:59

techlink81 发表于 2024-5-22 08:52:46

790 发表于 2024-5-22 08:52:56

captain漠九 发表于 2024-5-22 08:54:08

wangyitu 发表于 2024-5-22 08:56:00

居然还有编程经验分享
页: [1] 2 3
查看完整版本: PHP这个报错解决方法Non-static method xc_core::instance() should not b