Comparison of the differences between 7 popular integrated development tools (IDEs) for PHP
This article explores all the uses of an integrated development environment (IDE) and compares the costs and benefits of seven popular IDEs.
Writing this series of articles about PHP gave me a deeper understanding of the world of PHP developers. I've talked to many PHP programmers, and what's most surprising to me is how few use IDEs. Most programmers use a text editor such as Notepad, Emacs, or Vim on Microsoft Windows.
The text editors I've mentioned (and those I haven't mentioned) are all great - I don't want to argue about which editor is better. However, I would like to emphasize that not using a text editor will give you a deeper insight into your PHP code. Almost everyone thinks of a PHP project as nothing more than a directory of files (a very one-sided view). Now let me take you into the world of IDEs, show you what IDEs can — or should — do for you, and introduce you to seven of the most popular IDEs.
What is an IDE?
In short, IDE provides a one-stop service for coding work. An IDE includes an editor within which you can edit code, debug the code, view the code in a browser (usually embedded), and check in and out of source control. To support these functions, the IDE has a set of features not found in basic editors such as Notepad or Vim. Of course, you can extend the editor to achieve these features, but the IDE includes all of these features in one streamlined package - all preconfigured:
project
A key feature of the IDE is that it treats a PHP application as a project, not just a set of files. This concept - a project - maintains additional information, such as source control configuration, database settings for debugging, and the location of certain key directories.
debug
Another convenient feature is integrated debugging. Using this feature, you can set breakpoints in the editor, and the PHP interpreter will stop when it reaches this script. Starting from a breakpoint, you can inspect the values of local variables and diagnose problems in your code. You can use the echo statement in your code to check the value or you can use the error log to get the value of the variable.
Code intelligence
PHP is a very regular programming language, which means it follows simple patterns. Not only do these patterns make code easier to write, they also make it easier for the IDE to inspect the code in the project. In addition, they can help you write programs by displaying the results of inspections. For example, if you have a class named MyClass defined in your project, when you type the keyword new, the IDE will immediately provide a popup that includes MyClass as an option. When an object of that type is used, the IDE displays its available methods and instance variables. When you start typing a function command, the IDE displays its available arguments. To be fair, this is the number one reason why you should use an IDE instead of a text editor. This kind of code intelligence can effectively reduce mistyping class names, method names, and parameters.
Class view
Another function of the code intelligence engine in the IDE is that the IDE can generate a class view of the project. Instead of displaying files, the system displays the different classes that have been defined, regardless of the file in which they are located. When a class is clicked, the editor accesses the corresponding file and displays the corresponding class, method, or instance variable. This is a great way to navigate in large projects.
Multi-language support
Each IDE mentioned here not only supports PHP but also supports related language sets: javaScript, Structured Query Language (SQL), Hypertext Markup Language (HTML), and Cascading Style Sheets (CSS). Because HTML and CSS are relatively simple, IDE support for them is the best. Support for Javascript often highlights syntax, but support is better than no support.
Source code control
All of the IDEs reviewed here support some connection to a source control system, allowing versions of files in a project to be maintained over time. You can mark a particular version of a file as a release version so that you can revert it if changes need to be undone. Using a source control system is critical in a team environment, even for personal use. A good source control system comes into play when the disk crashes or when a customer suddenly wants a previous version instead of the current one. Most IDEs support Concurrent Version System (CVS) and Subversion, both open source control systems. One of the IDEs supports Perforce - a commercial source code control system.
FTP/SFTP integration
A feature related to source control is the use of FTP for the latest code on the server. This is much easier than using an FTP client or packaging the file yourself and sending it to the server and then unpacking it.
Database navigation
A non-basic but very useful feature is database navigation. Using this feature, you can browse the database accessed by the application, find table and field names, and return query results. Some systems can even automatically write some database access code.
Integrated web browser
Some IDEs support an integrated web browser, which allows you to navigate directly to the page being edited using specified additional parameters. This browser can be hosted within the IDE or called externally. To be honest, I'm not a big fan of the integrated browser because I don't mind switching between two separate applications for editing code and viewing results. But I know it does have a role, but you don't have to use it.
Fragment
The last feature I found in all these IDEs is support for entire and custom code snippets. A snippet is a small piece of code that performs a small task such as running a regular expression on some input, connecting to a database, and querying the database.
The above summarizes the core features that can currently be expected from purchased or open source IDEs. Next, some popular IDEs will be introduced, some IDE images will be shown, and the features they support and their costs will be explained.
Eclipse
There are two plug-ins in the Eclipse development platform that support PHP. The first PHP IDE project was an Eclipse Foundation project, which means it was released under the Eclipse license and developed using Eclipse Foundation tools and methods.
The other is PHPEclipse, which is developed independently. Because they use Eclipse, both plug-ins run on all three major operating systems: Windows, Linux, and Mac OS X. You can download just these two plug-ins (if you are already using Eclipse), or download the PRe-fab version that contains everything you need.
Both plug-ins support core IDE features. In particular, the code intelligence feature is very powerful and can pop up and display all required class, method and parameter information when needed.
Figure 1 shows PHPEclipse running on Mac OS X. On the left is the project view of the files in the project. Below is the class view, showing all defined classes. In the middle is the code. Multiple files can be opened in multiple tabs at the same time. On the right is the debugging and browsing panel. This is the commonly used PHPEclipse user interface.
Figure 1. PHPEclipse on OS X
Figure 2. PHP IDE project on OS X
If you can’t tell the difference, that’s okay. The two plug-ins do look very similar, as they both rely on the Eclipse platform for code browsing and intelligence features. It's nice to have consistency in the Eclipse plug-in GUI.
I'm not aware of a plug-in that locks you into a specific Eclipse project. You can frequently swap out one plugin for another. In my limited testing, I prefer the PHP IDE Project plugin because I feel it integrates better and the performance of the code intelligence features seems to be faster. Try both plugins and see which one you like better.
The disadvantage of these two plug-ins is that the UI is not tailor-made for PHP, because Eclipse can be used for almost all programming languages. As a result, Eclipse's terminology was initially somewhat offbeat. If you're new to Eclipse, these plug-ins are a little more difficult to learn than other IDEs. However, if you already know Eclipse, you can become familiar with PHPEclipse or PHP IDE projects relatively quickly.
What is the biggest advantage of Eclipse and these plug-ins? They are free, stable and reliable. Oh, did I mention they are free?
Komodo
The next one to introduce is ActiveState’s Komodo IDE. This IDE runs on Windows, Mac OS X and Linux and supports common open source languages - Perl, PHP and Ruby. The code intelligence engine is very reliable. It scans all language installations for custom extensions, such as the PEAR module. On the project side, it supports integration with CVS, Subversion, and Perforce, and also allows direct FTP transfer of code to the server.
Figure 3 shows Komodo running on Windows. On the left is the class view and on the right is the project view. The main part in the middle is the code view. Below are breakpoints, command output, etc. for debugging. For all of these systems, the UI can be customized as needed.
Figure 3. Komodo running on Windows
Komodo is a commercial product. As I write this article, this IDE is available in two versions: Personal Edition (US$29.95) and Professional Edition (US$299.95). One of its unique features is the regular expression debugger. Whether you're new to regular expressions or already dabbling in advanced regular expression features, this investment is well worth it.
The downside is that there's no database integration (at least I couldn't find one), and I've also run into the minor issue of code intelligence not always popping up when I want it to. However, overall, Komodo is a robust, feature-rich, and reliable PHP IDE.
PHP designer
The PHP designer is not the same as other IDEs. Of course, it supports limited code intelligence. However, it focuses more on the design aspects of PHP web applications. This is evident in its integrated browser, which specifically uses pixel rulers to help position elements on the page.
Figure 4 shows the PHP Designer running.
Figure 4. PHP Designer on Windows
The code intelligence and debugging features of PHP in the PHP designer are not very obvious, but the code intelligence support for HTML, CSS and JavaScript is relatively stronger. The PHP Designer is somewhere between the IDEs used by programmers, which is primarily focused on code, and Adobe Dreamweaver, which is more focused on design. If you're looking for this type of intermediate product, the PHP Designer is well worth considering, as the IDE is free for personal use and its professional version is only US$55.
PhpED
NuSphere's Windows-only PhpED is the most feature-rich of all the IDEs covered here. It has a good internal debugger and puts the debugging toolbar into Microsoft Internet Explorer for easier access to page debugging.
Figure 5 shows PHP application development using PHPEd in Windows. On the far left is the file view of the project. The one immediately to the right is the class view, and the far right is the code view. Below is the output status. You may have noticed that all of these IDEs follow the same basic design style.
Figure 5. PhpED in Windows
PhpED's standout features include a great debugger, excellent database access, better code intelligence features, and integrated PHP help. PhpED prices range from US$119 for the basic version to US$495 for the professional version. There is also a trial version available.
PHPEdit
PHPEdit from WaterProof Software feels like the Microsoft msdev environment for PHP – which is a nice thing. PHPEdit is a Windows-only IDE that is easy to set up. It even has a PHP version. It does a great job with code intelligence for PHP, CSS, and HTML, but does not provide support for code intelligence with JavaScript. Figure 6 shows PHPEdit running.
Figure 6. PHPEdit in Windows
For easy deployment, PHPEdit can connect to CVS and Subversion, as well as FTP and its own proprietary ezDeployment system. In addition to its code intelligence features, to speed development, the IDE has an excellent overall template library of code examples that you can add to. The evaluation version of PHPEdit is free to use, and the official version costs US$89.
Zend Studio
Finally, let’s talk about Zend Studio, which is listed last simply because it starts with Z. It should probably be the first thing that comes to your mind. Why? Because it comes from Zend - the elite team behind PHP. And it's really good. It runs on three major systems: Windows, Mac OS X, and Linux. And it provides absolutely everything you need: PHP V4, PHP V5, and more. It takes a long time to download, but is well worth it.
As an IDE, Zend Studio is the best. It provides all the code intelligence features you want in built-in libraries and custom code. It also has very good debugging capabilities and is extremely easy to set up. To put code into a repository, Zend Studio connects to CVS and Subversion. To put the code on the server, there is integrated FTP available. Zend Studio is well suited for Macintosh, as shown in Figure 7.
Figure 7. Zend Studio on Mac
In some other IDEs, code snippets are built-in to make coding easier. The IDE also integrates directly with databases to make available tables and fields.
The standard version of Zend Studio costs US$99, and the professional version costs US$299. Some of the features I mention here are not included in the standard version. A trial version of Zend Studio is available for free.
Conclusion
There are many great IDEs available - some of them are even free - and you can try one out, especially if you're a professional. You may need to pay company or personal consultant fees, or you may have to spend money to purchase necessary products. If you consider the time it takes to debug your code using echo versus using the integrated debugger, the IDE is definitely worth the purchase price.
The above has introduced the differences and comparisons of seven popular integrated development tools (IDEs) for PHP, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.