What’s New in the Zend Studio 13 PHP Editor

The new Zend Studio 13 includes PHP 7 support, and the PHP 7 Express migration assistant to help you migrate your existing PHP code to the upcoming PHP 7 version.  Plus, it adds lots of improvements and new functionalities. We are always working to make the life of PHP developers easier and more productive. With this short article I will describe some of the new cool features you can find in Zend Studio 13.

Colored visibility keywords

This is a change that has frequently been requested. Now the visibility keywords (public, var, protected, private) are colored differently.

image08

If you prefer different colors than the default ones then you can go to the PHP -> Editor -> Syntax Coloring preference page and change the color and styling.

image07

Organizing use statements

Previous versions of Zend Studio were just signalizing unused use statements. Now use statements list can be cleaned and organized in a much easier way. To do this, select the line with unused statement and press Ctrl + 1 (or just press the light bulb on the left ruler). From the displayed menu, select Organize use statements. Unused entries will be removed and the rest will be sorted alphabetically. The command to organize use statements can also be triggered with the shortcut Shift + Ctrl + O regardless of the PHP editor selection.

image01

Quick fix for inline @var comment

Each variable in the source code can now be easily described with inline @var comment. After selecting a variable in the PHP editor just press Ctrl + 1 and select Insert a variable comment from the displayed menu. The dialog that pops up allows you to search for a variable type name. As result a comment with a variable description will be inserted and code assist will be aware of its type.

image06

image03

image04

Deprecated API validator

This new validator helps track all deprecated code occurrences. It takes into account project dependencies, native elements and main source code. All findings can be found in the Problems view, and will also be marked in the PHP editor.

image05

Scanning larger project for all deprecated occurrences can be a heavy and slow operation, so it can impact the overall performance of the IDE. Therefore this validator is disabled by default. To enable it, go to the PHP -> Semantic Analysis preferences page and search for the Deprecated API entry in the Potential Programmer Problems category.

image00

You can focus only on deprecated elements by customizing the Problems view. To change the default settings choose Configure Contents… from the view menu (the triangle-shaped tool button).

image02

I hope you like the new improvements in the PHP editor. You can find the first three of them also in the open source Eclipse PDT, but the last one, the Deprecated API validator, is only available to Zend Studio 13 users.

Happy PHPing!