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 following construct yields a syntax error in NetBeans but is perfectly valid PHP 5.5. <?php foreach ([[ "foo", "bar" ]] as list($foo, $bar)) { } ?>
reproducible Product Version: NetBeans IDE Dev (Build 201404040001) Java: 1.8.0; Java HotSpot(TM) Client VM 25.0-b70 Runtime: Java(TM) SE Runtime Environment 1.8.0-b132 System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Parser needs to be improved. Thanks.
Fixed in web-main #e71f9614c822
Integrated into 'main-silver', will be available in build *201407040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/e71f9614c822 User: Ondrej Brejla <obrejla@netbeans.org> Log: #243409 - PHP 5.5 foreach() with direct array and list() gives syntax error #245320 - Incorrect syntax error in foreach 5.4
Verified Product Version: NetBeans IDE Dev (Build 201407040001) Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02 Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13 System: Linux version 3.13.0-29-generic running on i386; UTF-8; en_US (nb)
Perfect work as always, endless thanks Ondrej.
Created attachment 158675 [details] Error in foreach with list
Created attachment 158676 [details] No foreach error
This doesn't seem to be fixed. I am using: Product Version: NetBeans IDE 8.1 (Build 201510222201) Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1 Java: 1.8.0_66; Java HotSpot(TM) 64-Bit Server VM 25.66-b18 Runtime: Java(TM) SE Runtime Environment 1.8.0_66-b18 and running php 5.6. And I am getting a syntax error in Symfony files (which run without issue). Here is an example: (first attached file) // resolve definitions krsort($definitions); foreach ($definitions as $id => list($domElement, $file, $wild)) { <<code>> } I am getting the Syntax error on the foreach line. If I remove the "$id =>" the syntax error goes away. (second attached file) This code if from: vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php (there are more files with this error and also in the auto generated code from Symfony)
A bit different scenario. Please, next time report a new issue. Thanks.
I did. https://netbeans.org/bugzilla/show_bug.cgi?id=258200
(In reply to antoniocs from comment #11) > I did. > > https://netbeans.org/bugzilla/show_bug.cgi?id=258200 Thanks. Closing this issue back.