corner imagecorner image IDEPlatformPluginsDocs & SupportCommunityPartners
download NetBeans

NetBeans IDE 7.1 Features

PHP Development

PHP development in NetBeans IDE
Click image for full screen preview

A dedicated PHP coding environment and complete integration with web standards.

PHP Source Code Editor improved

The NetBeans PHP editor offers code templates and generation (Getters and Setters), refactoring (Instant Rename), parameter tooltips, hints and quick fixes (Implement All Abstract Methods), and smart code completion (including bracket completion). Benefit from syntactic and semantic code highlighting, pop-up documentation, code formating and folding, and marking of occurrences and exit points.

NetBeans IDE for 7.1 extends the code editor with clever try/catch code completion, smart method parameter pre-filling, rectangular selection, and hint improvements. The PHP Help has also been rewritten.

For more information about improvements to the PHP Editor, see the NetBeans for PHP blog.

Menu item for generating PhpDoc

PHP Projects

The NetBeans project offers a version of the IDE tailor-made for developing PHP web sites that comprise a variety of scripting and mark-up languages. The PHP editor is dynamically integrated with HTML, JavaScript and CSS editing features.

Focus on the code and speed up code scanning by excluding individual directories in the Project properties. The NetBeans IDE fully supports iterative development, so testing PHP projects follows the classic patterns familiar to web developers.

NetBeans PHP Navigator, PHP mixed with CSS and javascript

PHP Files Without Projects

You can edit, run or debug PHP files that are not in a PHP project. Open the file and press SHIFT-F6 to run the file. Open the file and press CTRL-SHIFT-F5 to debug the file. In either case, a dialog opens in which you can provide script run arguments, change the working directory, or specify PHP options.

NetBeans dialog for running a PHP file outside of a PHP project

Easy Code Navigation

Use the navigator window or the Go To Type, Go To File, Go To Symbol, Go To Declaration, Find Usages menu items for easy code navigation in large projects. The editor warns about potential code problems by flagging them and giving an hint in a pop-up. A tasks window lists all warnings in the project, making it easy to find and resolve problems.

Easy PHP code navigation

Zend, Symfony, and Smarty Frameworks improved

Create a new PHP project based on the Zend, Symfony, or Symfony 2 framework. Filter and view help for Zend or Symfony commands, specify command parameters, preview the whole command, and run it. You can also assign shortcuts to commands. Depending on the project, the list includes either Doctrine or Propel commands.

Install the Smarty framework plugin, available in NetBeans IDE 7.1, and NetBeans IDE recognizes Smarty template files in your project.
Zend Framework Support

NetBeans supports the PHP frameworks Zend and Symfony

PHP Debugging improved

Debug PHP code using Xdebug: You can inspect local variables, set watches, set breakpoints, and evaluate code live. Navigate to declarations, types and files using Go To shortcuts and hypertext links. Use a global PHP include path for all projects or customize it per project.

The NetBeans IDE for PHP also offers command-line debugging: The PHP program output appears in a command line display in the IDE itself and you can inspect the generated HTML without having to switch to a browser.

You can debug scripts and web pages, either locally or remotely. The NetBeans PHP debugger integration allows you to map server paths to local paths to enable remote debugging.

Starting in NetBeans IDE 7.1, all debugging options can be found under their own tab in Options.

NetBeans PHP debugger watches

Remote and Local Project Development improved

PHP projects can easily be deployed from within NetBeans IDE to local or remote servers via FTP or SFTP. You can easily create a new project from remote sources, and the IDE will upload your changes automatically when you save a file. Run the project as a local web site, as a command line script, or as a remote web application via FTP or SFTP.

NetBeans IDE 7.1 extends (S)FTP support with lazy file loading, keep-alive, and FTP over TLS/SSL. See Deploying a PHP Application on a Remote Web Server for more information.

Note: NetBeans provides basic support for FTP/SFTP, sufficient for a lone developer to work on a simple project. If you are working on a complex project or with multiple developers, you should use a version control system. The IDE also supports a range of version control systems, including CVS, SVN, Git, and Mercurial. For more information about NetBeans IDE's version control support, please see Version Control & Developer Collaboration.

NetBeans PHP - FTP configuration

PHP Unit Testing improved

Create PHPUnit tests and Selenium test cases for files or folders, run tests, and view test results. Starting in NetBeans IDE 7.1, you can define test groups to selectively run unit test upon. In the PHPUnit properties you can define a custom XML configuration file, a bootstrap file for command line options, or a custom test suite, or you can let the IDE generate skeleton code for you. Use a keyboard shortcut to navigate quickly between test and tested class.
Testing with PHPUnit and Selenium

NetBeans PHPUnit test results

 

Code Coverage

Generate a Code Coverage report for PHP files to see how well your test cases cover your code: Covered statements are marked green in the editor, statements that haven't been executed during the test are marked red. The evaluation is based on the number of executable statements, lines with white space and comments do not distort the result.

NetBeans PHP code coverage

Namespace and Variable Types

The PHP editor understands namespaces and variable type definitions in comments which improves code completion and hyperlink navigation. The Editor recognizes PHP code including heredoc notation in PHP projects and in PHTML, YAML, and PHP files, including the latest PHP 5.3.
PHP Namespace Support

NetBeans Editor: PHP code completion

MySQL Integration

PHP developers can also look forward to working with MySQL. The Insert Code command provides a Database Table option that creates the code needed to execute a SELECT statement in MySQL. Open a window to make changes to MySQL tables, select individual table cells with the mouse, and edit them directly.


NetBeans PHP - FTP configuration

Rename Refactoring and Instant Rename

You can alter the name of a selected type, type member, function, or constant in the code, using either Rename Refactoring or Instant Rename. Instant Rename renames all elements in the scope of one file. Starting in NetBeans IDE 7.0, the user can also use Rename Refactoring. Rename Refactoring can rename elements throughout a project.  Simply put the caret on the identifier and press Ctrl+R. A dialog opens in which you type the element's new name. You then preview your changes. You can decide to rename only selected instances of the element.

Instant rename still applies to local variables, parameters in functions or methods, and private members of a type. Instant rename does not require you to preview your changes.

NetBeans rename refactoring preview for PHP


PhpDocumentor Support

You can use NetBeans PHP IDE to generate PHP code documentation with PhpDocumentor. You must download PhpDocumentor yourself and make certain in the IDE Options that the IDE recognizes the PhpDocumentor installation and that the IDE has found the correct path to the PhpDoc script. The PhpDoc script must also point to the correct location of PhpDocumentor.ini. After you set everything up correctly, all you have to do is right-click a project node and select Generate PhpDoc. The IDE generates the PhpDoc files in the location of your choice.

Note: PHPDocumentor does not fully support PHP 5.3. Namespaces and some other 5.3 features are not documented by PHP Documentor.

Menu item for generating PhpDoc

  PHP Learning Trail

  NetBeans PHP Blog