详情页

Array and string offset access syntax with curly braces is deprecated

时间:2023年05月15日

编辑:佚名

xshop 1.0.6
thinkphp在php 7.4版本中出现错误提示
Array and string offset access syntax with curly braces is deprecated[D:\phpstudy_pro\WWW\xxx.com\thinkphp\library\think\db\Query.php:400]

问题解决方法
                        $seq = (ord($value{0}) % $rule['num']) + 1;
修改为
                        $seq = (ord($value[0]) % $rule['num']) + 1;
问题解析
PHP7.4不再支持使用大括号访问数组以及字符串的偏移_PHP代码
php7.4不支持数组{}写法,统一为数组[]
相关文章
猜你需要