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.
Product Version = NetBeans IDE Dev (Build 201211240959) Operating System = Mac OS X version 10.8.2 running on x86_64 Java; VM; Vendor = 1.6.0_37 Runtime = Java HotSpot(TM) 64-Bit Server VM 20.12-b01-434 Following code: <?php if (1 == 2 // false || 1 == 1) // true echo "this is true"; ?> Reproduce: - Enter code into Netbeans PHP IDE - Format code - Resulting code does not compile any longer! <?php if (1 == 2 // false || 1 == 1) // true echo "this is true"; ?> Even worse!!! Following code: <?php if (1 == 2 // false || 1 == 1 // true ) echo "this is true"; ?> Reproduce: - Enter code into Netbeans PHP IDE - Format code - Resulting code DOES compile BUT has now lost ACTIVE CODE! <?php if (1 == 2 // false || 1 == 1 // true ) echo "this is true"; ?>
Created attachment 128408 [details] IDE log
Reproducible.
Comments should be handled properly... I'll look at it. Thanks for reporting.
Sry, probably P2.
P2 would be my vote. My code ended up in production after being commented out and a test did not catch the regression. Very dangerous.
Fixed in web-main #6d636962d3c0
Integrated into 'main-golden', will be available in build *201211300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/6d636962d3c0 User: Ondrej Brejla <obrejla@netbeans.org> Log: #222774 - Formatting PHP code causes code to be commented out and may or may not still compile
verified Product Version: NetBeans IDE Dev (Build 201212060001) Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b17 System: Linux version 3.2.0-33-generic running on amd64; UTF-8; en_US (nb)