TP5报错:Array and string offset access syntax with curly braces is deprecated

技能 · 2020-08-04 · 541 人浏览
TP5报错:Array and string offset access syntax with curly braces is deprecated

报错语句:Array and string offset access syntax with curly braces is deprecated

报错原因:PHP7+更高版本不再支持使用花括号访问数组以及字符串的偏移

文件路径:thinkphp\library\think\db\Query.php [第400行]

代码原句:$seq = (ord($value{0}) % $rule['num']) + 1;

改后代码:$seq = (ord($value[0]) % $rule['num']) + 1;

Theme Jasmine by Kent Liao