编程语言

PHP 7.4 的 Array and string offset access syntax with curly braces is deprecated 的错误和解决方法

By karp 775 Views 1 MIN READ 0 Comments

PHP 升级到 7.4 之后,会收到 Array and string offset access syntax with curly braces is deprecated 的错误,这是因为:

PHP7.4 不再支持使用大括号访问数组以及字符串的偏移,就是不支持数组{}写法,统一为数组[]

比如:

$index{$start+7}

就要改成:

$index[$start+7]

本文由 karp 原创

采用 CC BY-NC-SA 4.0 协议进行许可

转载请注明出处:https://www.ikarp.top/index.php/archives/762.html

标签: php

0 评论