So the intellisense works for my own variables, methods, etc. but doesn't work for php functions like in_array... I'm just opening a single PHP file instead of creating a project. It works when I create a PHP project and create a php file inside that project. But doesn't work when opening individual php files.

VS.Php for VS2010 has intellisense for php functions when I just open a single php file. I'd like to emulate this functionality in Eclipse. Does anyone know how to make Eclipse PDT show php functions when opening a file?

The concept of projects is fundamental in eclipse. i doubt that it is possible. All the settings for autocomplete and others are kept within the .projects folder. I do no think that Eclipse is smart enough for that.
–
winteckApr 11 '12 at 20:28

How do you open a single file in Eclipse w/o having any project?
–
hakreApr 14 '12 at 1:59

3 Answers
3

Have you tryed netbeans for PHP? I've developed the past 2 years with netbeans+apache+php5+MySQL+MongoDB and used Netbeans all along on Ubuntu machines. The only thing it lacks at the moment is the code completion (intellisense) for the Mongo objects. Other then that it reads your code and complete PHP functions as well. And it's built on top of Eclipse (or at least derived from Eclipse). I think it's everything you're looking for.

As far as I know Eclipse doesn't have such a functionality. Eclipse works well in a project context. As I understand it, when you create a PHP project in Eclipse, it adds the PHP core libraries in this specific context. This makes sense because Eclipse support many languages, I use it to develop in C, Java and PHP and I certainly don't want all the libraries loaded at startup or each time I open a file.

To handle your issue, I created 'default' projects. I have 'PHPDefault', 'JavaDefault' and C++Default, each with appropriate settings and libraries. If you need to open a single PHP file from your OS, drag it to your project, if you want to open it from a remote location, copy it to your default project folder and refresh it from Eclipse so it will appear.