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

吾爱分享 建站运维 编程开发Use of undefined constant- assumed ” (this will throw an Error已关闭评论13,7041字数 118阅读0分23秒阅读模式

Use of undefined constant- assumed ” (this will throw an Error-图片1

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

Use of undefined constant- assumed ” (this will throw an Error-图片2

报错内容:[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]

 

 最后更新:2020-11-16
吾爱分享