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

Summary: Parse error in closures (PHP 7)
Product: php Reporter: malmsteenforce
Component: EditorAssignee: Tomas Mysik <tmysik>
Status: RESOLVED WORKSFORME    
Severity: normal CC: junichi11
Priority: P3    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Fragment of code that gives parse error, but shouldn't

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)