NetBeans 6.5 review
December 1, 2008 – 11:07 am Tags: general, PHP, ToolsDuring the weekend, I tried out NetBeans 6.5 and its new PHP related functionality. I had earlier seen some quick shots of how the support was, and it seemed like a good contender for big names like Zend Studio.
What features does NetBeans 6.5 have for PHP developers? How does it compare against Zend Studio for Eclipse?
Overview
At the general level, NetBeans is quite similar to most other IDEs: You get a project view on the left, an outline of the things in the current file under that, an editor on the right and a task/problem view below the editor. It does all the usual tricks you’d expect, like tabs in the editor, syntax highlight, PHP function code assist etc.
Other PHP related functionality it provides are things such as templates - when you type func, it can autocomplete an empty function for you, fast PHPDocumentor docblock comment creation, code-assist for custom PHP classes based on the docblocks, including what variables their methods take etc.
NetBeans also has refactoring support for PHP - something that I’ve only seen before in Zend Studio. For example, you can easily rename a variable or a method in your class, so that it gets renamed everywhere in your code where it’s used.
In depth
The PHP editor
This is of course the most important part. Zend Studio for Eclipse has a very good PHP editor, and other IDEs with PHP support that I’ve tried (such as Komodo) usually fall very far from it.
NetBeans, however, does about 95% of what Zend Studio does.
- Code-assist for builtin PHP functions? Yep.
- Code-assist for custom functions and classes? Yep.
- Quick insertion of phpdoc blocks? Yep.
- Displays phpdoc information in code-assist? Yep.
- Does above for variables, methods, methods’ parameters and all? Yep.
- Let’s you easily rename variables/methods/classes with a refactoring tool? Yep.
- Supports snippets/templates for quick inserting of function/class stubs etc.? Yep.
- Supports code folding? Yep.
- Supports jumping to the declaration of a variable/method/class? Yep.
Did I forget anything? Feel free to point it out!
NetBeans even does some of the things better than Zend Studio - which is definitely an achievement.

Click for bigger image
For example, the code-assist for builtins displays more information, and links to PHP manual. The code folding feature (ie. those little + signs that you can use to make funcs and comment blocks smaller) works reliably, unlike in Zend Studio where it can screw up and display your code totally wrong if you use the folding feature, which is luckily only a rendering glitch.
NetBeans’ PHP documentor support is very good as well. For example, it supports the @property declaration that isn’t supported by Zend Studio. This is useful for example when you work with Doctrine 1.1, as it generates those for your models to give code-assist for the model properties.
But while NetBeans gives you @property, its support for @return is a bit shaky. It works just fine as long as you have a single return value, ie. @return Zend_Layout, but it screws up when there’s more, like @return Zend_Layout|null, which is valid phpdoc and means it would return either an instance of Zend_Layout or null. In the latter case, NetBeans won’t give you any code-assist at all. I have filed a bug report for this, so hopefully it’ll be fixed in a future release.
The project view
The project view does a decent job of letting you go through the files and directories in your project with ease. It will also display little icons and color changes, if you’re using subversion, to indicate modified files and such.
While it’s otherwise good, I do have a minor gripe in regards to creating new items. If you hit Ctrl+N in Zend Studio to create a new item, you can simply type in “folder”, “file” or “php file” etc. and hit enter and be done with it. In NetBeans, you need to first choose the correct main “group” of items, then hit tab and choose one of the file types (or mouse click) and hit enter. For some weird reason, if you doubleclick one of the items with the mouse, nothing will happen, and you will need to click next.
So if you’re really used to the way Eclipse based IDEs handle creation of new files and dirs, this may initially be a small annoyance, but it still works okay after you get used to tabbing around the selections.
PHP debugging support
While I haven’t used this much yet, it exists and seems to work as you’d expect with functionality like setting breakpoints, stepping through code and viewing variable values. NetBeans’ debugger appears to work with XDebug instead of the Zend Debugger module you will require to use Zend Studio’s debugging features.
+1: NetBeans debugger immediately worked with the xampp installation I had on my PC. The installer already picked up my apache from there, and when I fired up the debugger, it worked seamlessly. Getting Zend Studio’s debugger up and running was a bit more of a hassle, and I actually needed to consult Google for that.
Version control support
NetBeans supports CVS, Subversion and Mercurial out of the box, but they may require an external download if you don’t have the correct client installed beforehand. The installation for those is automatic and relatively painless, though.
The svn support was a bit confusing as it did some things in a bit weird way, compared to what I had gotten used to with TortoiseSVN. However, it works rather well after you get to know the quirks.
Wait, there’s more
NetBeans does even more than that. It has better support for HTML, CSS, JavaScript and even formats like YAML.
Click for bigger image
When editing HTML in Zend Studio, it sometimes lets you autocomplete the closing tag, and it does display a list of attributes for some tags like form. That’s pretty much all it does.
NetBeans HTML editor is great - it autocompletes closing tags, lists attributes, even displays details on what the attributes do. It displays a lot of information for tags, too.
It doesn’t do that just for HTML - that happens in CSS as well. You get good information on the properties, and options for the values. It also features a “style builder” and a preview which lets you see how your selected style would look. As an added bonus, it seems to handle cascading styles correctly, so if you define that the body has a black background and your h1 declaration says the font must be white and bold, the preview has a black background too.
While the detailed infoboxes on HTML and CSS may not be of use to everyone, it could save you a trip to the W3C CSS spec - I know I have had to look things up from there from time to time.
And you get all this for JavaScript too - code-assist, function explanations, even for custom functions and complex objects. Oh, and debugging support in Firefox or IE. The JavaScript assist can even understand the difference between static and nonstatic functions (or whatever their proper JS terminology is), has some support for JSDoc etc.
Conclusion
Why aren’t you downloading NetBeans yet?
With all these features, the minor flaws in it don’t really matter - and they will hopefully get ironed out in a new release.
Did I mention it’s free? Yep, it has more features than the commercial big name Zend Studio does, and it’s completely free.
I probably forgot to mention something, since it’s got so many features in it. There’s also support for SQL etc. but I haven’t looked into those yet.
NetBeans 6.5 is officially my new favorite PHP/web-dev IDE.
RSS feed:Subscribe!












24 Responses to “NetBeans 6.5 review”
Personally I only use ide’s like that for languages I have less experience with. For PHP I use e (textmate for windows) or textmate (for the mac, duh)
By Harro on Dec 1, 2008
I recently switched from Eclipse PDT and dont regret it. I really like all the nice features which Netbeans has “out of the box”. While in Eclipse I had to install 5-10 plugins to support the things I need. Also the “building workspace” annoyance does not occur in netbeans. Of course Netbeans also has to parse the PHP files and annotations, but this is much faster and done in the backgroud. Your IDE isn’t blocked while the “task scanning” occurs.
The only performance flaw I could find was when working with shared folders (e.g. samba). Sometimes the task scanning, code completion or opening a file was a bit slower then usual. But that may also be a samba issue.
By thedave on Dec 1, 2008
Yeah most likely just a slowdown caused by the network latency or such. I ran some remote project in Zend Studio and it was horrible.
By Jani Hartikainen on Dec 1, 2008
Jani, got a link to your bug report? I’d like to keep an eye on it.
By eric on Dec 1, 2008
Here you go:
http://www.netbeans.org/issues/show_bug.cgi?id=154142
By Jani Hartikainen on Dec 1, 2008
This is the first open source PHP IDE that I have ever actually enjoyed using. Certainly beats my various Eclipse experiences.
By Stuart on Dec 1, 2008
How do you insert phpdoc blocks?
By JD on Dec 1, 2008
If you write a block of code, say..
you simply go on the line above the function declaration, and type in /** and hit enter.
By Jani Hartikainen on Dec 1, 2008
Hi, personally what I really like in NetBeans PHP code completion is how easy one can overrride methods in a class; if you extend a class, you can invoke code completion in the class’ body and you will get all the methods from all the parent classes/implemented interfaces (as well as all the magic PHP methods) - just select the method you want to override/implement and hit … very easy and very useful IMHO
By gapon on Dec 1, 2008
To my previous comment:
“and hit …” should be ” and hit ENTER…” of course.
(HTML tags were removed.)
By gapon on Dec 1, 2008
Another nice netbeans feature are the “code templates”. Like snippets but you can just type them in the code and also define your own templates.
Example: Type ‘tryc’ and hit tab. This will give you a complete try/catch block. Another example: Type ’swi’ and tab, and this will give a switch block like:
switch ($variable) {
case value:
;
break;
default:
break;
}
This could become handy if you can remember the abbreviations.
By thedave on Dec 1, 2008
NetBeans it’s a great IDE, I used it for Java (lighter than Eclipse) and now for PHP, JavaScript support is great, jQuery autocompletation!
:D and the SVN is faster than Subclipse, I hope just something like Eclipse RSE :’) but the nightly build version comes with SFTP support (with an Exception :P), I’m waiting for next release.
By Juan Felipe Alvarez Saldarriaga on Dec 2, 2008
The most important advantage of Netbeans 6.5 PHP over PDT is the reliable auto-completion for bigger projects. Netbeans automagically finds all the correct class-files in your path-directories.
Let’s see how PDT 2.0 will perform. It’s due to be released at the end of this month.
By Daniel on Dec 2, 2008
I moved over from Eclipse PDT a few weeks ago and so far I’m loving Netbeans. The Subversion support is great and saves messing around with Subclipse. It seems a lot faster too, none of the annoying hangs or crashes that I occasionally had in Eclipse. Good support for HTML and CSS aswell.
I won’t be going back to Eclipse anytime soon.
By Tom on Dec 2, 2008
Tried it out and it looked like a decent IDE, but the lack of line wrapping drove me crazy. How is this so unimportant to the developers? http://www.netbeans.org/issues/show_bug.cgi?id=89894
By Gábor Hojtsy on Dec 2, 2008
I’m curious why so many people seem to want line wrapping in the IDE. I mean you usually hear that “don’t type lines longer than X chars” and that limit is usually enough to keep on a single line.
One of the comments did explain it a bit, “I write little design scribblings and other ramblings in simple text files.”
By Jani Hartikainen on Dec 2, 2008
I liked NetBeans pretty well but it uses a lot of memory on my system — 140K+ and also a lot of CPU. Much more than any other text editor/IDE I’ve tried.
Maybe I’ll try it again if I upgrade my system (currently Windows XP, 1GB of RAM).
By Eugene Morgan on Dec 2, 2008
The PHPDoc autocompletion is driving me nuts. Eclipse PDT isn’t that much better in this regard. Why can’t they make the description, parameter var types and return fields focusable with tab like the other code templates? I really want to stop being lazy documenting my code, but the IDEs aren’t helping me!
The ${cursor} in NetBeans is also not focusable with tab, which is weird because it is used all over in its default code templates. I love the fact that code template shortcuts have a separate hotkey from code completion though. In Eclipse, it’s also Ctrl-Space and all functions and constructs starting with that shortcut comes up with it.
By torv on Dec 3, 2008
Christmas comes early! Thanks for the thorough review.
By Steve Clay on Dec 3, 2008
The only reason why I choose an IDE is for its debugging features. At now I’m quite happy with ZendStudio. Don’t know about NetBeans.
By Marco on Dec 3, 2008
Hi Jani, I also tried Netbeans (coming from a Zend Studio and Zend Studio for Eclipse background) and I noticed a few annoying bugs, one of them is the scope it warns about uninitialized variables. The scope seems limited to brackets, not so much the actual scoping PHP has. ( Screenshot: http://screencast.com/t/2rYUgBu0jI )
I also think that the layout looks sluggish. It is a bit hard to explain what I miss when I compare it with, for example, Zend Studio for Eclipse. But I get the feeling I suddenly have less space on my screen…?
The formatter of Netbeans is a real joke, it indents and that is basically all it does… I really hope they add features to the formatter as I think it’s one of the strengths of ZSE.
Other then that I think Netbeans is a win editor, it works like a charm and once they fix some of the open bugs and if they improve the formatter I’m switching to Netbeans without a doubt !
By Dynom on Dec 5, 2008
It runs much slower than eclipse in my ubuntu 8.1 w/ athlon x2 and 2g ram. A bit better when using nimbus theme. Does anyone exp the same?
By apit on Dec 16, 2008
I’ve been developing PHP apps for over ten years and have tried every IDE there is. PHPEclipse 2.0 is slightly better than PDT 2.0 and both are superior to ZSE. Netbeans PHP however easily beats all three. Netbeans PHP and Vim (for the quick edits when you don’t want an IDE) is the best setup I can think of for a PHP dev in 2009.
By John on Jan 2, 2009