李少杰:Warning: A non-numeric value encountered in xxxxx.com/wp-content/themes/begin/includes/base.php

  • A+
所属分类:原创

现在最新的wordpress程序5.9.3对php版本最低要求就是7.4,然而随着php版本的迭代升级,以前很多代码的写法和后面php版本新加入的一些运算符号都会导致网站在新的php版本下出现不兼容的情况,甚至会因没有做定义和转换报错,这次报错就是对于(+ - * / ** % << >> | & ^) 的运算未做数值类型转换,从而提示出现非法数值的报错(Warning: A non-numeric value encountered)。

解决方法也很简单,使用intval对那些运算进行强制转为数值型后就不会报错了。

具体操作方法,举例说明

找到对应的文件,修改前:

李少杰:Warning: A non-numeric value encountered in xxxxx.com/wp-content/themes/begin/includes/base.php

修改后:

李少杰:Warning: A non-numeric value encountered in xxxxx.com/wp-content/themes/begin/includes/base.php

修改后上传覆盖,报错即可解除。

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 李少杰
  • 扫码送营销教程
  • weinxin
lishaojie

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: