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.
the support in "Const array/string dereference": https://wiki.php.net/rfc/constdereference is not implemented good. while this is valid in netbeans: echo array(2,3)[1]; this isn't: function a(){ return array(3,4); } echo a()[0];
Not sure if it should work. Documentation [1] just talks about "array and string literals". Function dereferencing is not mentioned anywhere (or at least I didn't saw it anywhere...it's not in RFC [2] either, there are just literals too). [1] http://www.php.net/manual/en/migration55.new-features.php [2] https://wiki.php.net/rfc/constdereference So incomplete for now...I'll try to find some more info.
It should work since it's work. php 5.5 run it without any warnings: php > function a(){return [3,4];} php > echo a()[1] php > ; 4
Official example: http://il1.php.net/manual/en/language.types.array.php Example #7 Array dereferencing <?php function getArray() { return array(1, 2, 3); } // on PHP 5.4 $secondElement = getArray()[1];
Ok, I just tested that in NB and just "Language feature not compatible..." error occurs, so it's supported (it means it's parsed correctly), but wrong hint is used for PHP 5.5 project type. I'll look at it.
Fixed in web-main #ddbf4ce0d620
Integrated into 'main-silver', will be available in build *201309170002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/ddbf4ce0d620 User: Ondrej Brejla <obrejla@netbeans.org> Log: #236009 - the support in "Const array/string dereference" is not implemented good.
Verified. Thanks. Product Version: NetBeans IDE Dev (Build 201309191137) Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b17 System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)