XAMPP 7.4.8 安装新增,但"curly braces"梨错误



我安装了examplep Win32 7.4.8版(也尝试过8.0版(。我在安装phplicensewatcher时出现了错误,这里是:缺少HTML/Table或HTML/Common。。。

所以我试着用pear在XAMPP控制台中安装HTML_Table,但使用失败

# pear install HTML_Table
PHP Fatal error:  Array and string offset access syntax with curly braces is no longer supported in C:xampp2phppearPEARConfig.php on line 2095
Fatal error: Array and string offset access syntax with curly braces is no longer supported in C:xampp2phppearPEARConfig.php on line 2095

所以我看到,那里的许多文件都保存着";{0}";而不是";[0]";,文件日期为2016年。

我能做什么?

谢谢伯恩哈德

这是因为:

https://wiki.php.net/rfc/deprecate_curly_braces_array_access

假设你的代码中有这样的东西:

$str = "test";
echo($str{0});

由于PHP 7.4中获取字符串中单个字符的大括号方法已被弃用,因此将上述语法更改为:

$str = "test";
echo($str[0]);

最新更新