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.
I found no duplicate. PHP supports class constants: class A { const CONSTANT = 3; } Can be refered to like this: echo A::CONSTANT; And, just like static properties, class constants can be refered to through an instance of the class: $a = new A(); echo $a::CONSTANT; This works in Netbeans. But now, let's do the same using properties of an object, instead of simple variables: class B { private $a; public function f() { $this->a = new A(); $foo = $this->a::CONSTANT; // doesn't work as expected, in PHP, but makes no error in netbeans $bar = ($this->a)::CONSTANT // works nicely but raises an error in Netbeans } } Hope it's clear enough, but feel free to ask me for more details. I tested in the today's nightly (septembre 7th, 2016)
IMO duplicate of #258527. Thanks for reporting. *** This bug has been marked as a duplicate of bug 258527 ***
Indeed it probably has the same technical background but there is an important difference: in my case, using simple variables works fine (NB recognize the constant), but it's underlined as "error", in red, when used like this: ($this->field)::CONSTANT
(In reply to Ninj from comment #2) > ($this->field)::CONSTANT In such a case, see issue #259111. Thanks.
You are right, i didn't find see this one. Thank you. I can then just hope for a soon fix, but i understand it's harsh.