Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!

Bug 253894

Summary: PHP7 support in NB 8.1
Product: php Reporter: wegus <wegus>
Component: EditorAssignee: Ondrej Brejla <obrejla>
Status: RESOLVED FIXED QA Contact: issues <issues.netbeans.org>
Priority: P1 CC: ChrisLE, dasprid, TheTechFan, titus1006
Version: 8.1   
Target Milestone: TBD   
Hardware: PC   
OS: Linux   
Whiteboard:
Issue Type: ENHANCEMENT Exception Report:

Description wegus 2015-07-28 11:29:39 UTC
I just gave NB 8.1 Build 201507280002 a try and couldn't find any PHP7 support. Are there any plans to support the spaceship-opertator, return type declaration, scalar type hints ... ?
Comment 1 RiptideTempora 2015-11-07 03:35:30 UTC
If no one else wants to tackle this, please let me know and I'll attempt to contribute the patch!
Comment 2 tecs 2015-11-12 08:10:39 UTC
(In reply to RiptideTempora from comment #1)
> If no one else wants to tackle this, please let me know and I'll attempt to
> contribute the patch!

I was also looking at implementing the new features myself but then found out that most of them were working (scalar arguments types, return types, spaceship and coalesce operators) when I built NetBeans from source. The related commits can be found here - http://hg.netbeans.org/main/log/8f73454c4144/php.editor/tools/ASTPHP5Parser.cup

Only thing I spotted so far not working yet were anonymous classes.
Comment 3 bgarrison25 2015-12-08 17:12:47 UTC
This is in fact NOT true. I am using coalesce operators / use grouping / and a few other features of php 7 in my code and every one of them is showing up as a syntax error. This is REALLY annoying and im surprised its not fixed now that php 7 is actually released.
Comment 4 dasprid 2015-12-08 17:14:47 UTC
bgarrison, did you actually (In reply to bgarrison25 from comment #3)
> This is in fact NOT true. I am using coalesce operators / use grouping / and
> a few other features of php 7 in my code and every one of them is showing up
> as a syntax error. This is REALLY annoying and im surprised its not fixed
> now that php 7 is actually released.

Are you actually using Netbeans compiled from source?
Comment 5 lemon_juice 2016-01-03 13:17:08 UTC
(In reply to bgarrison25 from comment #3)
> This is in fact NOT true. I am using coalesce operators / use grouping / and
> a few other features of php 7 in my code and every one of them is showing up
> as a syntax error. This is REALLY annoying and im surprised its not fixed
> now that php 7 is actually released.

If you download the development version of NB the PHP 7 features listed at http://hg.netbeans.org/main/log/8f73454c4144/php.editor/tools/ASTPHP5Parser.cup seem to be working when PHP 5.6 is selected in project properties (there still is no PHP 7 option).

However, use grouping and anonymous classes are not yet done.
Comment 6 sruj 2016-01-07 03:42:22 UTC
@lemon_juice@netbeans.org

You saying any of these http://bits.netbeans.org/dev/nightly/ will cover every of these http://hg.netbeans.org/main/log/8f73454c4144/php.editor/tools/ASTPHP5Parser.cup ?

(sorry if this is stupid question)
Comment 7 BlameFate 2016-01-07 09:24:41 UTC
@sruj: I just loaded NetBeans Nightly Build from yesterday, and it appears to work well with many PHP7 syntax features - I'm surprised by how well it's working, and wouldn't go back to the "stable" v8.1 now. As suggested by lemon_juice, select PHP5.6 for your project as there is no separate "PHP7" option yet.
Comment 8 ChrisLE 2016-07-25 11:41:21 UTC
The nightly builds of NB 8.2 have fully PHP 7.0 support :)
Comment 9 Xenos 2017-02-17 15:11:48 UTC
Seems resolved to me since current NetBeans version (8.2) has PHP7 support.
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo