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.
Formatting a document with the following PHP code: copy($old,$new) or die("(proj) unable to copy $old to $new."); … removes the spaces around the keyword 'or', resulting in: copy($old,$new)ordie("(proj) unable to copy $old to $new.");
Sorry it is working for me correctly. What version of NetBeans are you using? (copy info from Help->About). Can you please try it in the latest dev version[1]? If it is not working, simply reopen this issue. Thanks. [1] http://bits.netbeans.org/dev/nightly/ Product Version: NetBeans IDE Dev (Build 201401100002) Java: 1.7.0_51; Java HotSpot(TM) 64-Bit Server VM 24.51-b03 Runtime: Java(TM) SE Runtime Environment 1.7.0_51-b13 System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Created attachment 143925 [details] NB 7.4 options export
Created attachment 143926 [details] formatting options screenshot
Still happening for me in the latest dev version you linked. Entire file contents: <?php copy($old,$new) or die("error"); ?> After choosing menu option Source > Format: <?php copy($old,$new)ordie("error"); ?> Screenshot attached as well as an export of all of my options.
I've narrowed the issue down to Options > Editor > Formatting > PHP > Spaces > Around Operators > Binary Operators. Evidently NB is treating the word version of operator in: function() or die(); … like the non-word '||' comparison operator. Removing spacing around the non-word operator is fine, but removing spacing around the word operator causes a coding error. The following statements also exhibit the same issue: // before formatting: copy($old,$new) xor die("error"); copy($old,$new) and die("error"); // after formatting: copy($old,$new)xordie("error"); copy($old,$new)anddie("error");
Now I got it! Thanks for exact steps. Reproducible. Product Version: NetBeans IDE Dev (Build 201401130002) Java: 1.7.0_51; Java HotSpot(TM) 64-Bit Server VM 24.51-b03 Runtime: Java(TM) SE Runtime Environment 1.7.0_51-b13 System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Fixed in web-main #7a78054d14f5
Wow, that was fast! Thanks for the fix guys :)
Verified. Thanks Product Version: NetBeans IDE Dev (Build 201401300001) Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b67 Runtime: Java(TM) SE Runtime Environment 1.8.0-b126 System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)