This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 268317

Summary: PHP 7.1 support
Product: php Reporter: ealexs
Component: EditorAssignee: junichi11
Status: RESOLVED FIXED    
Severity: normal CC: BeliverUfa, chrizzly, geertjan, junichi11, j_schumann, Kartopete, LWjuniOr, PowerKiKi, tmysik, Ximich
Priority: P2    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description ealexs 2016-10-03 09:15:34 UTC
When PHP 7.0 was released they have omitted a very important feature "Nullable Types". That "killed" return types.

PHP 7.1 fixes this with "Nullable Types" see https://wiki.php.net/rfc/nullable_types.

It would be great to have support for PHP 7.1 even with this feature only (on top of PHP 7.0).

PHP fans please vote :)
Comment 1 Tomas Mysik 2016-10-03 10:08:14 UTC
There are more features [1] that need to be supported for PHP 7.1.

Thanks.
[1] http://php.net/manual/en/migration71.php
Comment 2 ealexs 2016-10-04 08:40:22 UTC
MISSING FEATURES:

Nullable Types
==============
<?php ... function test(?string $name): ?string {...}

Multi catch exception handling
==============================
<?php ... catch (FirstException | SecondException $e) {}
- goes red in the editor

Support for keys in list()
==========================
<?php ... list("id" => $id1, "name" => $name1) = $data[0];
- goes red in the editor

Class constant visibility
=========================
<?php ... public const PUBLIC_CONST_B = 2;
- should be very easy to integrate

Symmetric array destructuring
=============================
<?php ... [$id1, $name1] = $data[0];
- not relevant ... we can just use list(...)

!!!THINGS THAT WORK OK!!!:

Void functions
========================
- works ok in the editor

iterable pseudo-type
====================
- shows ok in editor, no need to do anything

Support for negative string offsets
===================================
- works

The rest are just libs/function changes.


Thanks,
Alex
Comment 3 kacer 2016-10-19 13:46:09 UTC
+1 for PHP 7.1 support

My top priorities for supported new features are nullable types and void return type.
Comment 4 BeliverUfa 2017-01-09 20:58:35 UTC
+1 Thanks for working on this IDE. I hope you will create support of PHP 7.1.
Comment 5 Ximich 2017-01-28 11:32:59 UTC
+1
Don't want switch from NetBeans to PHPStorm only for php 7.1 support. Please add php 7.1 support to NetBeans)
Comment 6 ealexs 2017-02-06 08:49:12 UTC
Can we have a stage 1 for this issue please !!!

All we need is: 
1. Option to create a PHP 7.1 project
2. Modify the lexer to accept nullable types: "?TYPE"
(all we need here is not to highlight things as errors, 
just ingnore the "?" infront of a type)

I can help with the development if I get a bit of guidence 
especially with the LEXER.

PLEEEASE !!!

Regards,
Alex Stanciu
Comment 7 Christian Lenz 2017-02-06 09:21:44 UTC
Sounds great :)



(In reply to ealexs from comment #6)
> Can we have a stage 1 for this issue please !!!
> 
> All we need is: 
> 1. Option to create a PHP 7.1 project
> 2. Modify the lexer to accept nullable types: "?TYPE"
> (all we need here is not to highlight things as errors, 
> just ingnore the "?" infront of a type)
> 
> I can help with the development if I get a bit of guidence 
> especially with the LEXER.
> 
> PLEEEASE !!!
> 
> Regards,
> Alex Stanciu
Comment 8 kucerapetrcz 2017-02-17 08:29:40 UTC
It's been almost six months since the first RC version and still not implemented support for 7.1
This "bug" is here more than four months...
It's ridiculous

Switched to PhpStorm...
Comment 9 lolka_bolka 2017-02-17 08:38:54 UTC
(In reply to kucerapetrcz from comment #8)
> It's been almost six months since the first RC version and still not
> implemented support for 7.1
> This "bug" is here more than four months...
> It's ridiculous
> 
> Switched to PhpStorm...

It is. Luckily I have no hosts where is PHP7l so I do not develop under that, but I want to rewrite my framework to PHP7.1.

ealexs collected nicely, what they should do. Six month should be more than enogh.
Comment 10 ealexs 2017-02-17 08:45:41 UTC
Guys this is an easy win, all that people want is that the project will not go "all red" because of Nullable Types.
Everyone is moving from PHP 7.0 to 7.1 as 7.1 is already better supported (bugs fixed on 7.1 and not 7.0, ex: https://bugs.php.net/bug.php?id=74072 see "It is not possible to apply this change to PHP 7.0")

All we need is: 
1. Option to create a PHP 7.1 project
2. Modify the lexer to accept nullable types: "?TYPE"
(all we need here is not to highlight things as errors, just ingnore the "?" infront of a type)

Thank you, Alex
Comment 11 junichi11 2017-02-28 04:38:25 UTC
I'll do it. When it will be available, I'll write a comment here. So, please wait a while.

Thanks.
Comment 12 Starycjusz 2017-03-03 11:08:37 UTC
Are you doing this already junichi? Many of us are waiting, so when you has already declared to do this nobody else wouldn't.
Comment 13 junichi11 2017-03-03 11:35:55 UTC
(In reply to Starycjusz from comment #12)
> Are you doing this already junichi? Many of us are waiting, so when you has
> already declared to do this nobody else wouldn't.

Yes, I'm already working on this. As I wrote above, I will write a comment after I've finished it. Please wait since it takes time.

Thanks for your understanding.
Comment 14 junichi11 2017-03-24 04:04:29 UTC
I have improved the basic features(e.g. CC). 
Probably, it will be available tomorrow or later in the development build.
Please try to download and test it because there are bugs. If you find problems, please submit them to the NetBeans bugzilla as new issues.

Thanks!
Comment 15 weda2l 2017-03-27 12:05:36 UTC
Thanks. Fully fixed.
Comment 16 Kartopete 2017-04-11 12:00:24 UTC
Where do I find version which supports PHP 7.1. It is essential for our project and we are aiming to switch IDE if we cannot make this feature available. Any hint? 
PLease help!
Comment 17 Tomas Mysik 2017-04-11 12:10:13 UTC
Please, do not reopen FIXED issues, simply report a new one.

(In reply to Kartopete from comment #16)
> Where do I find version which supports PHP 7.1. It is essential for our
> project and we are aiming to switch IDE if we cannot make this feature
> available. Any hint? 
> PLease help!

You have to use development version of NetBeans [1] or wait for next stable version of NetBeans (likely NetBeans 9.0).

Thanks.
[1] http://bits.netbeans.org/download/trunk/nightly/latest/
Comment 18 donbidon 2017-08-11 06:09:32 UTC
+1, I need PHP 7.1 support.
Comment 19 kucerapetrcz 2017-08-11 07:01:17 UTC
This is no longer ridiculous, this is a tragedy.
The fix is completed for 4 months but is still not released.
Meanwhile PhpStorm added support for php 7.2 ...
Comment 20 junichi11 2017-08-11 07:15:57 UTC
(In reply to kucerapetrcz from comment #19)
> This is no longer ridiculous, this is a tragedy.
> The fix is completed for 4 months but is still not released.
> Meanwhile PhpStorm added support for php 7.2 ...

Unfortunately, NetBeans release cycle is related to new Java version. So probably, NB9 would be released next month.
However, fortunately, as Tomas wrote above, you can use a development version[1].

We already prepared for PHP 7.2[2] (we cannot apply it soon, sorry).

[1] http://bits.netbeans.org/download/trunk/nightly/latest/
[2] https://netbeans.org/bugzilla/show_bug.cgi?id=270929

Thanks for your understanding.
Comment 21 Christian Lenz 2017-08-11 07:41:34 UTC
The problem are the looong release cycles, we have to wait for the next big release for such feature which is not acceptable but it is as it is. Of course you can use nightly builds but as others, geertjan and I say, nightlies are not made for production usage. A patch would have been better.
Comment 22 LWjuniOr 2017-08-11 07:48:16 UTC
As for me, I use nightly builds for months now in production, but I had to experiment which is stable. Now I use a 20170325 build, it is stable and PHP7.1 works just fine :)
Comment 23 ealexs 2017-08-11 08:52:01 UTC
How about releasing such features as plugins before the the stable release is ready ?
I think this type of feature makes a perfect candidate for a plugin rather than core.

Thanks.
Comment 24 Christian Lenz 2017-08-11 08:54:45 UTC
I know that for the nbgit plugin. It started as a plugin and went to the core later. Same for twig. It could be a still a module for NetBeans but it should be released separately. Yes. Other IDEs/Editors have faster release cycles. This is a problem for years for NetBeans. Visual Studio Code brings an update each month. IntelliJ, WebStorm, PHPStorm I don't know but they release fast too.
Comment 25 PowerKiKi 2017-08-11 15:28:00 UTC
I also am frustrated by the release cycle for PHP support. The work was done a while ago now. But it only is available through dev builds. And unfortunately those dev builds are far from being stable. I get regularly get Java exceptions and everything seems to be slightly slower than a production release.

On the other hand I am using a plugin to add support for TypeScript (https://github.com/Everlaw/nbts). Its release cycle is not tied to NetBeans and it's working great.

So I am kinda wondering why does PHP need to be tied to NetBeans release ? what are the advantage for end-users and/or developers ?

junichi11, do you know whether it would be technically possible to release PHP as a independent plugin more often ?

I don't think we need releases every week. Whenever a new PHP version is released should already be plenty enough and remove a lot of frustration for PHP developers.
Comment 26 Christian Lenz 2017-08-11 15:31:45 UTC
It's not about the PHP release, it is about the NB release and what comes with NB. With NetBeans you have HTML/JS/CSS/SCSS/LESS, PHP, Java, C/C++ and something more. So if there are changes in those parts, they need to wait for a next release. Sometimes it happens after a release that you got patches, most of the time with bug fixes but somestimes little enhancements.

So it maybe this can be changed under Apache to have a better release cycle. It is really a pain in the ass and I used the nightlies long time ago every day with success and pain (I know the java exceptions too).
Comment 27 Christian Lenz 2017-08-11 15:32:29 UTC
But this is not part of this topic, unfortunately we have to wait and hope for a better release cycles under apache. Maybe we should create a new ticket, but in JIRA, not here anymore.
Comment 28 PowerKiKi 2017-08-13 14:48:54 UTC
Reported on JIRA: https://issues.apache.org/jira/browse/NETBEANS-51

Please contribute to the discussion over there, if you feel like the release cycle should change.
Comment 29 Kartopete 2017-08-14 04:26:23 UTC
For me personally, I am in a situation where I would like to have most recent PHP in a stable release asap. However, this is due to our current situtation. I guess if you start a new software product, you always aiming at a stable IDE version which supports latest PHP. Later usually, you only very seldom update your PHP once a new version is there and therefore you could wait for a stable release with latest PHP. 
But ... as I said, right now, I would like to see this release as well, as I think some major features for PHP 7.1 have been missing on stable version. 
Cheers guys
Comment 30 ealexs 2017-08-14 06:13:58 UTC
Stable software is great, stable software takes time.
We need evolution not revolution.

The questions is: Can we have PHP x.x as a plugin ? so we don't have to wait for 1 year to get support for some very simple features, most of them drivven by a lexer configuration.
Comment 32 IdaWallace 2019-01-30 08:42:06 UTC
Must read information for those who face NetBeans issues because it is letting us about Apache issue tracking system for new NetBeans issues. 

Ida,
Finance assignment writer,
<a href="http://www.assignmenthelpfolks.com/finance/">http://www.assignmenthelpfolks.com/finance/</a>
Comment 33 IdaWallace 2019-01-30 08:44:46 UTC
Must read information for those who face NetBeans issues because it is letting us about Apache issue tracking system for new NetBeans issues. 

Ida,
Finance Assignment Writer,
http://www.assignmenthelpfolks.com/finance/