当前位置: 首页 > 工具软件 > Curly > 使用案例 >

[PHP] php 7.4 Array and string offset access syntax with curly braces is deprecated

钮巴英
2023-12-01

使用thinkphp的项目在php7.4下出现这个错误

原因是访问字符串中的某个字符时使用了大括号

从7.4以后,只能使用第一种形式$value[0]获取字符串偏移了,第二种方法$value{0}被弃用。

降级为php7.3就能解决,或者修改代码中访问字符的方式

 类似资料: