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:
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:
As you would expect, NetBeans provides code completion here, of course:
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.
NetBeans also support new operators that come with PHP 7, these are combined comparison (spaceship) and null coalesce operators:
As the last feature today, we will show you support for generator delegation:
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).
Awesome great to see PHP7 functionality coming :) still my favourite IDE.
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!