【发布时间】:2017-10-10 11:13:47
【问题描述】:
我安装了 PhpStorm 版本 2017.2 并在 Settings > Languages and Frameworks > PHP > PHP Language Level 下配置了 PHP 7.1
不幸的是,当对字符串变量使用空数组索引运算符时,它没有突出显示可能的错误(描述:http://php.net/manual/de/migration71.incompatible.php#migration71.incompatible.empty-string-index-operator)
代码:
<?php
$test = 'a string';
$test[] = 'an array value';
echo "it works";
使用 PHP 7.1.x 执行代码时出现以下错误
致命错误:未捕获的错误:[] 中的字符串不支持运算符
所以代码肯定不行。
谁能帮我配置 PhpStorm?
【问题讨论】:
标签: php phpstorm php-7.1 incompatibility