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 257362 - Error on const array access inside a class
Summary: Error on const array access inside a class
Status: RESOLVED DUPLICATE of bug 250579
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-02 13:51 UTC by adipinto
Modified: 2016-01-06 02:35 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Parsing error (56.97 KB, image/jpeg)
2016-01-02 13:51 UTC, adipinto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description adipinto 2016-01-02 13:51:36 UTC
Created attachment 157969 [details]
Parsing error

Netbeans highlights an error on below working code:

<?php
class TestClass {
    const OP_COMMANDS = array(
        "a" => 11111,
        "b" => 22222
    );
    public function output() {
        $v = TestClass::OP_COMMANDS["a"];
        return $v;
    }
}

$t = new TestClass();
print $t->output();

Currently a parsing error appears on the following line:
$v = TestClass::OP_COMMANDS["a"];

The code runs correctly without any error. I have attached the screenshot to show it well.
Comment 1 junichi11 2016-01-06 02:35:42 UTC

*** This bug has been marked as a duplicate of bug 250579 ***