12

我知道 PHP7 还没有发布,但是我想开始尝试它,为了做到这一点,我最好继续使用 PhpStorm。问题自然是它还没有语言支持。

我已经编译了 PHP7 源代码并将其作为解释器添加到 PhpStorm,令人惊讶的是它接受了,但这对语言级别没有影响。所以我的猜测是解释器用于调试,IDE 使用自己的解析器来调试代码。

有没有人找到一种方法在 IDE 中获得对 PHP7 的支持?即使它是世界上最混乱的解决方案,也足够了。

4

1 回答 1

17

That's not possible with current versions on PhpStorm -- it has to be natively supported by IDE.

Support for PHP7 will come only in v10 (e.g. no mention for v9 in current roadmap -- no need to support something that is still work in progress, especially since v10 will be released close to PHP7 target dates).

UPDATE ( 21/05/2015 ):

Based on today's tickets it's quite possible that PHP 7 support will actually be added in PhpStorm v9.

UPDATE ( 22/05/2015 ):

Master ticket: https://youtrack.jetbrains.com/issue/WI-27468 (check linked tickets for particular features).

UPDATE ( 08/07/2015 ):

PhpStorm v9 has been released with very basic PHP7 support.


I have compiled the PHP7 source and added it as an interpreter to PhpStorm, which surprisingly it accepted, however this made no impact on the language level. So my guess is the interpreter is for debugging and the IDE uses its own parser to debug code.

Generally speaking -- you are correct here.

Interpreter is used to execute and debug your local (or remote via SSH) scripts and other external stuff that required specifying php executable (e.g. PHPUnit tests etc). It is also used by built-in simple web server if it's used to serve your pages.

At the same time specific language level (5.4, 5.5, 5.6 etc) is set separately and requires IDE to know about such new constructs/syntax etc which means it has to be coded first (as IDE has its' own PHP parser/lexer).

于 2015-04-20T11:13:53.103 回答