Author: Lada Riha (

Following text is supposed to point out features of PhpStorm that could be useful in NetBeans. Its purpose is not to find “best PHP IDE” but to suggest what could be implemented in NetBeans in future. Just because this text contains functionality implemented by PhpStorm and not by NetBeans it doesn’t mean that NetBeans is worse. I simply did not include information about what is better in NetBeans (and yes, there is a lot of thing :)

I did not include everything I've found, but only the in my opinion most interesting and useful functionality. The most important and most wanted in NetBeans would be probably features mentioned in section Refactoring. Ability to inspect code for potential problems, rename php class file together with class renaming or find duplicates are really useful and help user to better/easier reorganize code.

See similar NetBeans 7.1 vs Eclipse for PHP Developers 3.0.2



Expand and optimize CSS property

Imagine you have following code in css file:

    border-top-right-radius: 4em;
    border-top-left-radius: 4em;
    border-bottom-right-radius: 4em;
    border-bottom-left-radius: 2em;

In that case PhpStorm shows annotation hint that allows you to shrink it to just one line:

    border-radius: 4em 4em 4em 2em;

Now it shows another annotation that lets you expand the code to the original 4 line form.

Customizing code styles and font styles and colors

  • Enhancement bug: [1]
  • Enhancement bug (already created): [2] and [3]

PhpStorm and NetBeans both offer a lot of options to customize code styles. One has more detailed settings of that, the other one of something else so it’s hard to tell which is better. However PhpStorm offers also settings for PhpDoc which is missing in NetBeans. Also PhpStorm let user to define some settings for other web related languages (HTML, CSS, JS...).

Configuration of font styles and colors is way better in NetBeans. For example in PhpStorm you can’t change color setting without creating new custom color scheme. Also font settings are more detailed in NetBeans.

Code completion in Find dialog

  • Enhancement bug: [4]


PhpStorm offers code completion in Find dialog. It works in all file formats and makes finding a bit more faster.

Show applied styles for tag

  • Enhancement bug: [5]


Right click on some HTML tag and press ‘Show applied styles for tag’. Window with all applied css properties will be shown. It also works in Smarty tpl file in which relative addresses for css styles (used in “<link rel=”stylesheet”...”) are not the same as they are in generated php file. This feature is in some way similiar to CSS Preview in NetBeans but instead of showing the styled element, it lists all its style properties.

Autocorrection of PhpDoc

  • Enhancement bug: [6]


If you change method declaration so the PhpDoc doesn’t correspond anymore, it is underlined and a hint shows explanation. If you click on the bulb icon, you can automatically update PhpDoc.

Formatting of unused variable

  • Enhancement bug: [7]


All unused variables are gray by default in PhpStorm. Personally, I like it more then underscoring in NetBeans.

Also there is a nice feature that tracks unused values of variables. Look at the picture below you can see that $foo is overwritten immediately and PhpStorm shows it as unused variable (value) and shows hints with explanation.


JavaScript debugger

Built-in debugger for client-side javascript.

Extract method

Similar to Extract method feature described below for PHP. You can select code block and convert it to method and its call.

Node.JS plugin

Node.JS is a JavaScript framework/platform for server-side JavaScript (see This plugin offers code completion, debugging, running application etc (there is a workaround for running nodejs applications in NetBeans by setting a PHP project to run as a Script and set PHP Interpreter to Node script.

File management

Name of copied file

  • Enhancement bug: [8]

If you copy some file in PhpStorm and press Ctrl+V to paste it, you are asked to specify new name. I think this is more useful than NetBeans way when the new file is automatically renamed to “name_1”. On the other hand, in the rename dialog in PhpStorm there is by default name of the original file, so you have to manually change it. I guess ideal way is to combine these approaches, after pasting file user could be asked to specify new name but the “name_1” will be prefilled so he could simple confirm it.


Inspect code

  • Enhancement bug: [9]


I’ve found this feature quite useful. It inspects code (php, html, js, css...) in selected files/project and looks for potential errors like empty tags, usage of deprecated methods, incorrect php doc, spelling problems and so on. For some errors it offers quick fixes or excluding them from result. Problems can be grouped by severity, directory etc. You can also export results to html or xml file. Of course there is option to select what should be find with which severity so you can adjust inspections in global scope or per project.

Extract Method

  • Enhancement bug (already created): [10]

Extract Method action allows to replace selected piece of code with method call. If you select some code and invoke this action, new method will be defined (you can select properties such as parameters, visibility and name) and instead of the selected code there will be single line method call (and of course this method will contain the selected code).

There are also actions like Introduce variable (see blog here) but I don’t think they can really save some time.

Refactor Rename

  • Enhancement bug (already created): [11]

Both IDE support refactor rename on php classes. I can’t figure out how to force PhpStorm to rename also occurrences of the class name in other files. This handles NetBeans way better. However PhpStorm has a nice feature to rename containing file. So if your php file contains only this one class, you can rename the file itself during the rename refactor action. This is useful if you are using autoloaders that relies on file name.


  • Enhancement bug: [12]


PhpStorm allows to find duplicate parts of code. You can specify which language (file format) should be inspected (PHP, HTML, JavaScript...). For each format there are some options to narrow down the inspections (for example for PHP you can specify minimum number of lines of code that could be marked as duplicate). There is also option to inspect only specified files or the whole project.


Show recent changes


Using keyboard shortcut Shift+Alt+C you can easily review all recent changes you’ve made. You can also select some listed file and review changes the same way as if you use versioning system. It’s not a killer feature but it can help you to get in the picture if you haven’t seen your project for some time.

Compare with clipboard

  • Enhancement bug: [13]


This feature allow you to compare selected code with content of your clipboard. The result is displayed in the same way as if you use some versioning system and sometimes it may be pretty handy (not only for php code but in general for all languages).

Local history for directories

  • Enhancement bug: [14]

This basically only lists all changes in all files in directory, but it’s faster way to track changes in directory than checking every single file.



PhpStorm can generate sort of UML diagrams from given classes so it is easier to understand architecture of your project. You can show class’ methods and variables and do some basic refactoring from the diagram (i.e. renaming). Diagrams can be exported to various formats (png, jpg...) or printed. This is also useful for making documentation.

Show Structure

  • Enhancement bug: [15]


PhpStorm equivalent of NetBeans’ Navigator offers more filter options (show contants, show fields, includes, show inherited etc.) while in NetBeans there are only 3 options to use and some of this functionality is in Php Type Hierarchy. In PhpStorm it also tries to deduct type of variable.

Open URL

This is probably not going to be used a lot but sometimes it can be useful. PhpStorm can open file from given URL.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo