【问题标题】:PhpStorm IDE 2017.2 does not highlight the error " [] operator not supported for strings" in PHP 7.1.xPhpStorm IDE 2017.2 在 PHP 7.1.x 中没有突出显示错误“[] operator not supported for strings”
【发布时间】: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


    【解决方案1】:

    这是一个错误,请在这里投票:https://youtrack.jetbrains.com/issue/WI-36636

    【讨论】:

    • 非常感谢您的回复。无需更多答案。
    猜你喜欢
    • 1970-01-01
    • 2012-09-02
    • 1970-01-01
    • 2020-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-28
    • 1970-01-01
    相关资源
    最近更新 更多