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.
Created attachment 159309 [details] stacktrace Reproducible code: <?php class Foo { /** * * @var Bar */ public static $bar; function __construct() { self::$bar = new Bar(); } } class Bar { /** * * @var Baz */ public static $baz; function __construct() { self::$baz = new Baz(); } } class Baz { /** * * @var Qux */ public static $qux; function __construct() { self::$qux = new Qux(); } } class Qux { public static $test = "test"; function __construct() { } public function test() { echo "test"; } } $foo = new Foo(); echo $foo::$bar::$baz::$qux::$test; $foo::$bar::$baz::$qux->test(); Thanks.
Taking over. Thanks.
Hmm, this is complicated - the last lines are marked by NetBeans PHP parser as syntax errors even if they are valid in PHP 7. The cause is that the grammar of the NB parser cannot be easily updated for "$a::$b::$c" cases (reduce/reduce error). I plan to have a look at it later but still hope that it will not be a major problem because instead of using: echo $foo::$bar::$baz::$qux::$test; one could (should? would?) use: echo Qux::$test; which makes better sense to me. Lowering to P4, in FCS builds assertions are not enabled so no error will occur. Thanks for reporting.
I see. This code does not mean much :) I just wanted to confirm whether "$a::$b::$c" can be used actually. Thanks!
I have removed the assertions, it can easily happen that NB is not able to resolve types correctly (missing files, typos etc.). Thanks. http://hg.netbeans.org/web-main/rev/09c1daf09765
*** Bug 260934 has been marked as a duplicate of this bug. ***
*** Bug 258991 has been marked as a duplicate of this bug. ***
*** Bug 258971 has been marked as a duplicate of this bug. ***
*** Bug 262156 has been marked as a duplicate of this bug. ***