开发者

Eclipse PDT: Syntax Errors with valid PHP Namespace Syntax

I'm using Eclipse 3.6 (Hel开发者_高级运维ios) with PDT 2.2, and I'm getting syntax errors when trying to "use" namespaces.

Is there something I can do to fix this?

Example:

use Tables\Exceptions\Exception as Exception;

The PHP Parser recognizes "Tables" as a syntax error on this line and others like it.


This is probably related to your interpreter settings in Eclipse.

Go to the Project menu and select Properties. Once you have the Properties screen up you can go to PHP Interpreter and adjust the PHP Version, either at the project level or the Workspace level.

Set the PHP Version to 5.3 or higher for proper highlighting.

If your project is in PHP 5.2 than you won't be able to use namespaces. See here: Namespaces in php 5.2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜