PHP - Eclipse PDT - 突出显示未初始化(拼写错误)的变量

时间:2021-10-05 11:39:15

I use the wonderful Eclipse PDT for PHP development.

我使用精彩的Eclipse PDT进行PHP开发。

I often encounter irritating bugs due to me misspelling variable names.

由于我拼错了变量名,我经常遇到烦人的错误。

Is there a way to highlight variables that have not been initialized? As they will almost certainly be due to a spelling mistake.

有没有办法突出显示尚未初始化的变量?因为他们几乎肯定是由于拼写错误。

Thanks for any help.

谢谢你的帮助。

3 个解决方案

#1


No. Due to the dynamic, sometimes hackish nature of PHP, it would overall be a pain to have variables that the IDE thinks is undeclared be underlined. Since many functions can declare variables on their own (such as extract), this would be a major hindrance.

不可以。由于PHP的动态,有时是hackish性质,因此将IDE认为未声明的变量加下划线总体上会很痛苦。由于许多函数可以自己声明变量(例如提取),这将是一个主要的障碍。

#2


zend studio has this feature so i'm not sure if we'll see it in pdt, it will also highlight unreachable code, etc.

zend studio有这个功能所以我不确定我们是否会在pdt中看到它,它还会突出显示无法访问的代码等。

#3


JEdit with PHPParser plugin had that, IIRC. It's been long since I tried it, though, I might be wrong.

带有PHPParser插件的JEdit有,IIRC。但是,我尝试它已经很久了,但我可能错了。

#1


No. Due to the dynamic, sometimes hackish nature of PHP, it would overall be a pain to have variables that the IDE thinks is undeclared be underlined. Since many functions can declare variables on their own (such as extract), this would be a major hindrance.

不可以。由于PHP的动态,有时是hackish性质,因此将IDE认为未声明的变量加下划线总体上会很痛苦。由于许多函数可以自己声明变量(例如提取),这将是一个主要的障碍。

#2


zend studio has this feature so i'm not sure if we'll see it in pdt, it will also highlight unreachable code, etc.

zend studio有这个功能所以我不确定我们是否会在pdt中看到它,它还会突出显示无法访问的代码等。

#3


JEdit with PHPParser plugin had that, IIRC. It's been long since I tried it, though, I might be wrong.

带有PHPParser插件的JEdit有,IIRC。但是,我尝试它已经很久了,但我可能错了。