项目新上线,突然报错Array and string offset access syntax with curly braces is deprecated,搜了一下,原来是环境配置的问题,一直都是7.3,换了7.4就芭比Q了
PHP7.4不再支持使用大括号访问数组以及字符串的偏移
php7.4不再支持数组{}写法,统一为数组[]
修改位置:\thinkphp\library\think\db\Query.php 的 400 行左右
修改为:
s
e
q
=
(
o
r
d
(
seq = (ord(
se
q
=
(
or
d
(
value[0]) % $rule[‘num’]) + 1;