Getting PhpStorm ready for Xdebug 2.6

When it comes to PHP debugging, Xdebug is the de-facto standard. With the 2.6 version released last week, it’s a good time to take a look at the new features. And since Xdebug has always been tightly integrated with PhpStorm, we’ve been preparing ourselves for it, too.

PHP Language Support

First and foremost, be warned: Xdebug 2.6 drops support for PHP 5.5 and 5.6. Only PHP 7 and later is now supported.

If you haven’t upgraded your project yet, this could be another reason for you to consider doing so. PhpStorm will assist you with the task by highlighting the language features which are no longer supported. You can also run the Language level inspection against the entire project scope to get the errors overview:

lang_level_inspection

Escape sequences handling

In earlier PhpStorm and Xdebug versions, you may have come across situations in which the property names had been encoded or parsed incorrectly. As a result, such properties’ values could not be retrieved by the debugger, and all you received instead was an error message.

PhpStorm 2017.3 and Xdebug 2.6 have improvements and fixes in this area. Specifically, the issue with handling ‘\0’ characters has been dealt with:

properties_parse_3

The properties containing backslashes and quotation marks in their names are now also retrieved as expected:

properties_parse

PHP Notices and Warnings reporting

With Xdebug 2.6, the DBGP debugging protocol can pass notification data to IDEs. Specifically, the PHP Notice and Warning errors are now passed from the debugger engine to PhpStorm. When a PHP notice or a warning is issued, it will now be displayed in the PhpStorm debugging Console. You can instantly jump to the corresponding line in your source code by clicking the link in the message:

Screen Shot 2018-01-31 at 12.31.07

We hope that these additions will make debugging a more pleasing experience. In case you are totally new to debugging in PhpStorm, refer to the Ultimate Guide and start shaking those bugs off!

Your JetBrains PhpStorm Team
The Drive to Develop

This entry was posted in Cool Feature, Newsletter and tagged , . Bookmark the permalink.