Use of undefined constant- assumed '' (this will throw an Error

靖宸
靖宸
靖宸
40
文章
0
评论
2020年11月15日22:45:25Use of undefined constant- assumed '' (this will throw an Error已关闭评论 2,716 401字阅读1分20秒

Use of undefined constant- assumed '' (this will throw an Error

问题背景:在使用Easy Digital Downloads的edd alipay支付网关插件时,在php7.2及以上版本时报此错误

Use of undefined constant- assumed '' (this will throw an Error

报错内容:[highlight color="yellow"]Use of undefined constant- assumed '' (this will throw an Error in a future version of PHP)[/highlight]

原因分析:php7.2及以上版本从新规定了常量的命名方式,需要带引号

解决办法:

原代码  [highlight color="yellow"]$settings[alipay_payment_edd]=$alipay_settings;[/highlight]

修改后的代码  [highlight color="yellow"]$settings['alipay_payment_edd']=$alipay_settings;[/highlight]

 

靖宸