Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 268712 - "Unexpected '[' after identifier" with constant array in a namespace
"Unexpected '[' after identifier" with constant array in a namespace
Product: php
Classification: Unclassified
Component: Editor
All All
: P3 (vote)
: 8.2
Assigned To: junichi11
Depends on:
  Show dependency treegraph
Reported: 2016-10-27 12:38 UTC by Jack_Brody
Modified: 2016-12-15 12:11 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT

8.2 complaining about a constant referenced within a namespace (12.51 KB, image/png)
2016-10-27 12:38 UTC, Jack_Brody

Note You need to log in before you can comment on or make changes to this bug.
Description Jack_Brody 2016-10-27 12:38:26 UTC
Created attachment 162658 [details]
8.2 complaining about a constant referenced within a namespace

Syntax checking apparently does not put up with constant arrays in a NAMESPACE. It's the leading backslash what is causing problems.

How to reproduce:

1) create a new PHP 5.6 project, with UTF-8.
2) create a new file "test.php"
3) write: $a = \TEST[0];
4) you get the syntax error in the screenshot

Product Version: NetBeans IDE 8.2 (Build 201609300101)
Java: 1.8.0_101; Java HotSpot(TM) 64-Bit Server VM 25.101-b13
Runtime: Java(TM) SE Runtime Environment 1.8.0_101-b13
System: Windows 7 version 6.1 running on amd64; UTF-8; cs_CZ (nb)
Comment 1 junichi11 2016-11-03 05:51:49 UTC
Thanks for reporting!
Comment 2 junichi11 2016-11-08 01:59:15 UTC

Comment 3 junichi11 2016-11-08 02:23:44 UTC
When this fix will be available in the dev build, the comment for it is added here. Then, could you verify it in the dev version?

Comment 4 Tomas Mysik 2016-11-08 09:24:05 UTC
Thanks for the fix, Junichi!
Comment 5 Quality Engineering 2016-11-09 09:02:37 UTC
Integrated into 'main-silver', will be available in build *201611090620* on (upload may still be in progress)

User: Junichi Yamamoto <>
Log: #268712 - "Unexpected '[' after identifier" with constant array in a namespace
Comment 6 Jack_Brody 2016-11-11 09:09:41 UTC
I have just verified the issue with NetBeans IDE Dev (Build 201611110001) and I can confirm that it has been resolved. Thank you!
Comment 7 Tomas Mysik 2016-11-11 09:24:59 UTC
Thanks for verification!
Comment 8 Tomas Mysik 2016-12-03 14:08:20 UTC
Transplanted to the releases repo branch release82:

Comment 9 amobilia 2016-12-15 12:11:47 UTC

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