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 268921 - Parse error in closures (PHP 7)
Summary: Parse error in closures (PHP 7)
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-10 08:10 UTC by malmsteenforce
Modified: 2016-11-10 09:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Fragment of code that gives parse error, but shouldn't (2.99 KB, image/png)
2016-11-10 08:10 UTC, malmsteenforce
Details

Note You need to log in before you can comment on or make changes to this bug.
Description malmsteenforce 2016-11-10 08:10:01 UTC
Created attachment 162857 [details]
Fragment of code that gives parse error, but shouldn't

Netbeans gives parse error in perfectly legal statent (see screen).
Steps to reproduce:
1) Make a project in PHP 7
2) Paste the following code:

(static function($arg){
    echo $arg;
})("display");

3) Save.

You'll get parse error. But when you'll go to PHP official page you'll se that this statement is perfectly legal since closures and anonymous functions exist.
My version of PHP in Netbeans is 7.0 (I've check the path to php.exe file in settings).
Comment 1 Tomas Mysik 2016-11-10 09:06:20 UTC
This is already fixed in dev build (thanks Junichi!) and should be part of the patch for NB 8.2.

Thanks for reporting.

Product Version: NetBeans IDE Dev (Build 20161110-5f9acf1b42b8)
Java: 1.8.0_111; Java HotSpot(TM) 64-Bit Server VM 25.111-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_111-b14
System: Linux version 4.8.0-27-generic running on amd64; UTF-8; cs_CZ (nb)