X

PHP 7 Support (Part 1)

Hi all, today we will show you our support for PHP 7 which will be part of NetBeans 8.2.

First, please let me thank our NetBeans user Junichi Yamamoto who is helping a lot with developing of new features as well as fixing of existing issues. Thanks a lot, Junichi!

Please note that PHP 7 is a huge update of NetBeans PHP support so your help with testing and reporting issues is more than welcome (and really appreciated!), thank you. Instructions can be found at the end of this blog post.

As the first step, you should set PHP 7.0 as the PHP version of  your PHP project:

PHP 7 support in NetBeans

One of the new features of PHP 7 is return type declarations; it means that now, PHP functions and methods can declare what type the given function/method returns:

PHP 7 support in NetBeans

As you would expect, NetBeans provides code completion here, of course:

PHP 7 support in NetBeans

Another nice improvement is that in PHP 7, also scalar types can be used for declaration. An example can be found below together with activated code completion that provides these new types as well.

PHP 7 support in NetBeans

NetBeans also support new operators that come with PHP 7, these are combined comparison (spaceship) and null coalesce operators:

PHP 7 support in NetBeans

As the last feature today, we will show you support for generator delegation:

PHP 7 support in NetBeans

We will continue with the rest of the new features available in PHP 7 next time (soon so stay tuned! :)

That's all for today, as always, please test it and report all the issues or enhancements you find in NetBeans Bugzilla (component php, subcomponent Editor). You can also leave a comment here (please notice that the comments are moderated so they will not appear here immediately) but reporting issues is strongly preferred (no issues described here in comments will be fixed, sorry; only Bugzilla counts).

Join the discussion

Comments ( 2 )
  • chris Monday, May 2, 2016

    Awesome great to see PHP7 functionality coming :) still my favourite IDE.


  • naitsirch Wednesday, May 11, 2016

    It's a pity that it will take some time until we can use PHP7 in my company (until next Debian stable is released).

    But it'great that Netbeans will support PHP7 soon.

    Thanks for all the work!


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha