Despite what some might say, I believe that code completion (aka Intellisense) is the second best invention when it comes to code editors (the first being syntax coloring). It really makes coding easier because I don't have to worry whether I named the function CalculateReportSums
, ReportSumsCalculate
or simply GetReportSums
.
Unfortunately I have not yet found a code editor which would satisfactory implement this feature for PHP. And by "satisfactory" I mean "as good as Visual Studio for C#".
My first choice of text editor is Notepad++, but that only has a list of PHP's built-in functions, and it only appears after you hit Ctrl+SPACE. I've also tried Eclipse+PDT, which is better, but still often has hiccups, sometimes fails altogether for no apparent reason (no list available), and always appears only when I pause typing (setting the timeout to some small value causes the list not to appear altogether).
So - is there something better out there? Something that would be aware of all the variables in the current scope, that would be able to follow include()
s, and would display the list in real-time as I type?
I know that PHP is a dynamic language and a perfect code-completion is impossible in principle (because you don't know what variables will be there until runtime), but it should still be possible to implement it to a fairly good degree - much better than what I've seen so far.
Added: To add a few minor points - I want the CC to be instantaneous, like in Visual Studio. I type a character, and the list shows at the same instant. I type another character and the list becomes half the size before I can even blink. Near-zero CPU usage, instantaneous results (all hail the Gods of caching!).
Also - I'm fine with documenting my functions and even variables in a special way. I prefer PHPLint syntax (because then I can check my code with it later), but other syntaxes will do as well. Forcing to do this is also good for your commenting discipline. :)
A: Eclipse for PHP works really great with CodeIgniter. Netbeans is another good IDE, and Sublime is a good code editor for CodeIgniter.
Visual Studio Code is a great editor for PHP development. You get features like syntax highlighting and bracket matching, IntelliSense (code completion), and snippets out of the box and you can add more functionality through community-created VS Code extensions.
I have found that Netbeans has better code completion than Aptana. When I was working with codeigniter, Netbeans would code complete for my static methods in models where Aptana wouldn't.
Since my posting of this, JetBrains has released PHPStorm and has your rapid fire intellisense, as well as even better type hinting. It is absolutely superior to all others IMHO. I've been using EAP 2.0 for several months now for free.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With