Eclipse PDT has been around for awhile now and keeps getting better and better. Especially with their new powerful PDT 2.0 release. It has all the great features that the 1.x version had such as debugging in Zend or Xdebug, syntax highlighting, code completion and project outlining. However as this is a new release there are alot of new and improved features.
New Features
Lighter Weight
PDT 2.0 has built in caching and language indexing that helps to improve the overall performance. As Eclipse is a plugin based platform PDT 1.x had alot of dependencies on other third party plugins that it no longer needs. As these other plugins are no longer required and are not loaded, this lowers the overhead needed to run eclipse PDT.
Improved Code Completion
There is also improved functionality such as better code completion. In PDT 1.x there were issues determining what type of object a variable was and what properties and methods to expose in code completion as PHP is a loosely typed language (you don’t have to implicitly declare your variables). PDT 2.0 is more powerful in the sense that it will crawl through your code searching to find what the last assignment of that variable was and what type of object it was assigned and shows you more accurately the properties and methods of that object.
Occurrence Marking
Another nifty feature is the ability to highlight occurrences of a variable. Simply hold ctrl and click on the variable and it will highlight all other occurrences of that variable. This is a very simple yet very great feature for quickly scanning through your code and finding variables in complex code.
Buildpath Configuration
So for your code completion and error displays eclipse PDT ‘builds’ your project. Basically its just compiling information. The problem with 1.x is that it went through ALL of your files including html, css, javascript and any other file that was included in the entire project. For large projects this can be a tremendous amount of overhead and can leave you sitting there waiting while the project is ‘building’. With PDT 2.0 you can specify exactly what your buildpaths are and where you want PDT to look to ‘build’ your project. This allows you to separate your php resources from your other web resources and thereby reducing the amount of overhead == wait time.
Type Hierarchy
The road map of PHP is definitely object oriented. With this in mind, PDT introduces the ‘Type Hierarchy’ view. This allows you to view an objects properties and methods and be able to differentiate between inherited and non-inherited properties and methods. Simply highlight your variable and press F4 and it will open up your Type Hierarchy view.
Tags: PDT
