dsdzz04802
2012-12-31 12:53
浏览 68
已采纳

如何在Aptana IDE中显示未定义的php变量通知?

How is it possible to see notices about undefined variables in the problem window of Aptana?

I want to write clean source code and the hint for PHP notice is important for me, at first in the IDE and less in the running application as it's already "too late".

Maybe Aptana has an option to activate this to see the PHP notices, not only error and warnings?

See my screenshot, maybe its easier to understand my question. On this screen I will see PHP notices, warnings and errors. enter image description here

A example of code, that create a PHP notice in webapp, in browser:

<?php

echo $undefined_var;

The var is not defined and result in this notice message:

Notice: Undefined variable: undefined_var in /var/www/wp-plugins/my-test.php on line 3

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duancai9010 2012-12-31 13:44
    已采纳

    AFAIK Aptana (and also other Eclipse PHP editor plugins like PDT) do not report Undefined Variable warning / notices for the Problems view.

    PHP itself gives this notice only, when the code is executed. So an IDE must also somewhat "execute" the code or do a more high-level static code analysis to report these kind of problems.

    An IDE I know of that does this is Phpstorm, which is very good with the static code analysis part.

    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • doujie7346 2012-12-31 14:35

    I don't think it's possible to report undefined variables in Problems view, but in latest Aptana releases you can configure a debugger (I tried XDebug) and then run it.

    enter image description here

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题