简体   繁体   English

如何在 PhpStorm 中导航到 PHP 关键字源代码?

[英]How to navigate to PHP keywords source code in PhpStorm?

In my PhpStorm I write a code snippet:在我的 PhpStorm 中,我编写了一个代码片段:

final class Demo{
    public function __construct()
    {
    }
}

在此处输入图像描述

But how can I navigate to keywords source code?但是如何导航到关键字源代码? such as final , class , public .finalclasspublic

Is it possible to do that?有可能这样做吗?

Those keywords are the so-called reserved keywords which are built into PHP language and the IDE's interpreter, there is NOT ANY WAY to follow them because you can not create or change them, for a complete list visit:这些关键字是所谓的保留关键字,它们内置于 PHP 语言和 IDE 的解释器中,没有任何方法可以跟踪它们,因为您无法创建或更改它们,完整的列表访问:

https://www.php.net/manual/en/reserved.keywords.php https://www.php.net/manual/en/reserved.keywords.php

Or even see: https://www.php.net/manual/en/reserved.php甚至见: https://www.php.net/manual/en/reserved.php

These words have special meaning in PHP.这些词在 PHP 中具有特殊含义。 Some of them represent things which look like functions, some look like constants, and so on - but they're not, really: they are language constructs.其中一些代表看起来像函数的东西,一些看起来像常量,等等——但实际上它们不是:它们是语言结构。 You cannot use any of the following words as constants, class names, function or method names.您不能将以下任何单词用作常量、class 名称、function 或方法名称。 Using them as variable names is generally OK, but could lead to confusion.将它们用作变量名通常是可以的,但可能会导致混淆。

As of PHP 7.0.0 these keywords are allowed as property, constant, and method names of classes, interfaces and traits, except that class may not be used as constant name.从 PHP 7.0.0 开始,这些关键字允许作为类、接口和特征的属性、常量和方法名称,但 class 不能用作常量名称。

PHPStorm doesn't support it, nor any other IDE (those I know) support it. PHPStorm 不支持它,任何其他 IDE(我知道的)也不支持它。 You can navigate to builtin functions, classes but not to language keywords / language constructs.您可以导航到内置函数、类,但不能导航到语言关键字/语言结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM