What's New in Eclipse PHP Development Tools
Eclipse has a long history in providing tools for PHP development. The Eclipse PHP Development Tools (PDT) project was created back in 2006. The Neon release is the 10-years anniversary of the project.
Let's take a tour of what the Neon release brings for PHP developers.
PHP 7 Support
The initial support introduced with PDT 3.6 is now complete in PDT 4.0. The code editor supports all the new cool features in PHP 7, including:
- Uniform Variable Syntax
- Anonymous Classes
- Scalar Type Hints
- Return Type Declarations
- Spaceship Operator
- Null Coalesce Operator
- Group Use Statements
- Generator Delegation
New, Faster PHP Indexer
Indexers are fundamental for IDEs. They rip the source code to basic lexical units: variables, function name, parameters, etc. This data is persisted in an organized structure – the index. The IDE queries the index whenever you invoke the code assist or request a search. The performance of indexing operations is crucial for the user experience with the IDE.
The PHP indexer is re-implemented using Apache Lucene – a high-performance text search engine. This allows significant performance improvement. Building the index is now 3x faster, while consuming 3x less space on the file system. Code assist, code navigation, validation and search are also faster. They scale better on multi-core CPUs.
The new indexer allows data querying while the index is still building. This make the code assist and code navigation more responsive. There are no more UI freezes when invoking code assist during index building.
More Performance Improvements
Besides the new indexer, the latest PDT comes with some more performance improvements:
- The code assist works faster in huge files containing lots of assignment operators.
- The PHP editor works faster in configuration files containing huge arrays (thousands of lines).
- The smart indentation and the generation of PHPDoc are faster too.
The PHP editor improves code reading by enabling more semantic highlighters. This makes easier recognizing classes, constants, access modifiers and deprecated usages.
The code assist dialog received much needed care:
- If you resize the dialog, it saves the new size for the next time you invoke code assist.
- Methods and functions display also the return type.
- Colors for secondary data improve the readability.
New quick fixes and quick assists help coding faster and cleaner:
- Quick assist for assigning a statement to a new local variable.
- Quick assist for adding a @var comment to a variable for improving code assist.
- Quick fix for organizing use statements.
- Quick fix for removing the unused use statements.
Code assist inside PHPDoc blocks works better after @param, @return and @throws tags.
The debugging support received a lot of attention during the last year. The quality improved for both Xdebug and Zend Debugger integrations.
One new feature is the support for PHP breakpoint exceptions. It works only for Xdebug, because Zend Debugger does not support this kind of exceptions.
Importing existing PHP code is easier than ever. The latest PDT takes advantage of the new Smart Import wizard.
File → Open Projects from File System… from the main menu. Then browse the file location of your PHP code.
We've just seen the major new features and improvements. There are many more little improvements included in the Neon release. The PDT team closed more than 300 Bugzilla items in the last 12 months.
How to get it
There are many ways for getting the latest Eclipse PDT tools:
- Download Eclipse Neon and select the "Eclipse for PHP Developers" package.
- Download the "Eclipse for PHP Developers" package direcly from the Eclipse package page.
- Extend your existing Eclipse installation by installing the "PHP Development Tools (PDT)" feature from:
- The Eclipse Marketplace
- The Eclipse Neon Simultaneous Release software repository
Please report bugs in the project's Bugzilla.