A PHP IDE (Integrated Development Environment) is a program which integrates many functionalities which help developers create quality code more quickly.
I have reviewed many PHP Editors and explained why they are indispensable tools when creating PHP code.
PHP Editors offer auto completion, syntax highlighting and symbol browsing. Some of them offer wizards that help with writing common code constructs.
PHP IDEs take these functionalities to the next level and add more interesting ones.
First, I will describe these functionalities. Later, I’ll see how these functionalities are implemented in some PHP IDEs.
A good PHP IDE has to check your code’s syntax by just pressing a button or, better, in real time. It’s better if this happens automatically, without needing to configure it.
A debugger executes your code showing the result of its execution alongside the code itself. Obviously you can slow down the execution and stop it to take time to inspect variables and execution flow. The best PHP IDEs have an integrated debugger needing little set-up.
Generally, a PHP file is edited by one developer only. Sometimes two or more developers need to edit the same file. A versioning system makes this possible, avoiding conflicts or incongruent versions of the file. Such a system also keeps trace of every change made to a file along with its reason. This helps to solve problems caused by changes. A good PHP IDE supports many versioning systems without needing to install plugins or additional software.
A developer has to make naming choices continuously. She has to give a name to variables, functions, files, classes, and so on. It may happen that some choices are revealed to be poor, conflicting or unclear.
To remedy these problems is not simply an aesthetic pastime. A variable whose name has nothing to do with its content, can cause misunderstandings, mistakes and loss of time.
PHP IDEs offer functionalities, which go under the name of refactoring, that globally change names to more meaningful ones. Attention has to be paid not to alter a code’s behaviour.
Refactoring is not only about changing names. More advanced PHP IDEs have more sophisticated refactoring functionalities meant to improve code quality without altering its working.
If you write comments about functions following the PHPdoc standard, a tool named phpDocumentor will collect all the comments you have written and make an html documentation which is easy to navigate.
When you change a function, just change the comments about it and the documentation will be changed accordingly and automatically.
Every PHP project should have at least this sort of documentation, and a PHP IDE should support this.
This is less important. It’s needed if you do test-driven development. This means that first you define a test which a piece of code has to pass to be declared functional, and then you write that code. PHPUnit is software which you have to install and which your PHP IDEs has to seamlessly interface.
Integration with frameworks
If a PHP IDE somehow integrates with one or more PHP frameworks, it’s a good plus.
Now I’m going to review some PHP IDEs. They all will be multiplatform. You don’t want to learn another PHP IDE if this means that you have to change platform. PHP IDEs need quite a lot of time to learn.
I’ve reviewed Geany as a PHP Editor. It has a few IDE functionalities as well.
If you install the php interpreter on your computer, Geany will check the syntax of your code. Not in real time.
Using a plugin, Geany will interface your versioning system. You can interface Geany to Subversion (also named SVN).
Unfortunately Geany doesn’t work with xdebug or other php debugger. To debug your code you have to use echo, var_dump or similar commands. However, this way to debug php code is perfectly fine for small and medium projects.
There is no integration with frameworks and forget about PHPUnit.
Geany is very light and good for small projects.
Netbeans is a java application.
When I started it, I cringed when I saw the fonts it used.
Happily, I found that I could fix it.
Executing this command:
export _JAVA_OPTIONS=”-Dawt.useSystemAAFontSettings=on -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel”
Before running Netbeans, I instructed Java to use system fonts instead of its own. I also set the default look-and-feel to GTK, which looks much better than the standard one.
Doing this, Netbeans’ look-and-feel is acceptable. You can enjoy the functionalities and forget about the look-and-feel.
Netbeans checks your syntax in real time and without needing to configure anything. It gives you abundant hints about mistakes and keywords.
Netbeans interfaces with the well-known, and widely-used, debugger Xdebug. You have just to do some configuration.
Support for versioning systems is integrated. Subversion, CVS and Mercurial are the versioning systems used.
Refactoring is a menu item. Ready to use straight out of the box.
What about PHPdoc? Just type “/**” and hit Enter precisely before a function’s definition. Netbeans will create a PHPdoc compliant comment including the description of the function’s parameters. This is great.
PHPUnit is supported.
Netbeans will help you write code for these PHP frameworks: Zend, CakePHP, Yii, Symfony2, FuelPHP. Just install the specific plugin.
Eclipse helios for php developers
Eclipse is the base for many other PHP IDEs. Here I’ll review the version of Eclipse named Helios and customised for PHP developers.
Eclipse checks your syntax automatically in real time and nothing needs to be configured.
Xdebug and Zend debugger are supported. The latter is very good.
You can interface with a SVN repository by using a plugin named Subeclipse that you find in the menu item “Help -> Eclipse Marketplace”.
A couple of refactoring functions are offered via a menu item named Refactoring. Netbeans has more of them.
When you type “/**” and hit enter, the same miracle as with Netbeans occurs. You get a skeleton phpdoc comment with the parameters of your function. Just do it before a function’s definition.
PHPUnit is supported and needs some configuration as it happens in Netbeans. This is expected as PHPUnit is an external product.
Zend Framework is based on Eclipse and you can install software that enables Eclipse to create Zend projects.
With some dirty tricks you can have at least autocompletion for the most common functions of any framework.
Aptana Studio 3
Aptana Studio is for Ajax applications. It’s a son of Eclipse and it’s fully customised to help build Ajax applications.
There is no refactoring, PHPUnit and PHPDoc are supported. You can debug php code using the usual Xdebug if you install and configure it.
PHPStorm is a commercial product.
Versioning is well-supported. Many Version Control Systems are supported including Subversion, Mercurial, Git, Perforce, CVS, and TFS.
Syntax checking is quite advanced and there are no problems with PHPUnit and PHPDoc.
Even frameworks are supported out-of-the-box. There is integrated support for Symfony2, Yii and Zend.
Refactoring functions are way more sophisticated than the ones featured by Netbeans or Eclipse.
Be sure to run PHPStorm on a very powerful computer.
Komodo IDE is another commercial product. I have reviewed Komodo Edit, the free editor that is a simplified version of Komodo IDE.
Komodo IDE shines for its debugging capabilities. You can even see inside what is transmitted between client and server via the http protocol! If there is no encryption you can see passwords travelling from your PC to the server!
Incredibly, refactoring functions are missing.
Zend Studio is as elephant-like as Zend and both are commercial products.
Obviously Zend Studio integrates very well with Zend. I would definitely use Zend Studio for a Zend project.
Refactoring is quite good and support for PHPdoc and PHPUnit is provided.
You can use your favourite Versioning System because Zend Studio will likely support it without needing plugins.
UPDATE: Just an additional review about CodeLobster
PHP IDEs need time to learn. They are more complex than PHP editors and offer more sophisticated functions.
For small projects Geany is good. It’s light and has a neat interface.
Netbeans is better when projects get bigger and more complex. It has many functions ready to use without annoying hassle.
I would use Eclipse helios for php developers if I needed a plugin to solve a particular problem. Eclipse has more than 1,000 plugins. I guess that I’ll find something to suit my needs.
Aptana Studio is good if you develop Ajax applications even if you have to renounce some functions.
PHPStorm is an interesting product. It’s easy to use and offers a lot of tools without needing any strange configurations or installation procedures. Debuggers are integrated and this is a very good thing.
Komodo IDE should be considered if you need strong debugging tools.
Zend Studio is the elephant. Use it if you have to develop using Zend framework.