Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Eclipse PHP not recognizing namespace declarations?

When I type "namespace ORM;" in Eclipse, it underlines ORM in red and says that it is expecting a parenthesis. Is there a way to make Eclipse recognize namespaces?

like image 253
JayD3e Avatar asked Feb 02 '23 23:02

JayD3e


1 Answers

It's probably your project that is set to the 5.1/5.2 version. You can change the default in:

Window > Preferences > PHP > PHP Interpreter > PHP Version > 5.3

Alternatively you can go in Project Properties (right-click your project then Properties) then PHP Interpreter, tick Enable project-specific settings and change the PHP Version there.

like image 52
netcoder Avatar answered Feb 05 '23 16:02

netcoder