我安装了PhpStorm版本2017.2并在设置>下配置了PHP 7.1。 语言和框架> PHP> PHP语言水平 em> p>
不幸的是,当对字符串变量使用空数组索引运算符时,它不会突出显示可能的错误(描述: http://php.net/manual/de/migration71.incompatible.php#migration71。 incompatible.empty-string-index-operator ) p>
代码: p>
执行代码时 使用PHP 7.1.x发生以下错误 p>
致命错误:未捕获错误: p>
blockquote>中的字符串不支持[]运算符 n
因此代码肯定无法正常工作。 p>
任何人都可以帮我处理PhpStorm配置吗? p>
div>
<?php
$ test = 'a string';
$ test [] ='数组值';
echo“it works”;
code> pre>
I installed PhpStorm version 2017.2 and configured the PHP 7.1 under Settings > Languages and Frameworks > PHP > PHP Language Level
Unfortunately it does not highlight possible errors when using the empty array index operator on string variables ( description: http://php.net/manual/de/migration71.incompatible.php#migration71.incompatible.empty-string-index-operator )
Code:
<?php
$test = 'a string';
$test[] = 'an array value';
echo "it works";
When executing the code with PHP 7.1.x the following error occurs
Fatal error: Uncaught Error: [] operator not supported for strings in
so the code is definitely not working.
Can anyone help me with the PhpStorm configuration?