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 133425 [details] Code snippet See the attached file, it's a PHP file in which I output javascript code into a buffer to use in the future. Netbeans seems to believe the javascript "return false;" is a PHP statement in an incorrect place. That's kinda confusing but I doubt this should be happening since the code is properly written. Netbeans says "Invalid return statement" Thank you for any feedback.
Hi, do you have installed the latest patch? If not, please try Help->Check for updates and install all updates. There are fixes for mixed languages similar to your sample. I tried this in PHP file <script> function test() { <?php ob_start(); if (true) { ?> console.log("A"); $("AAA").css("width"); return false; <?php echo "A"; } ?> } </script> and it works in 7.3 with patch. If it doesn't work, then it would be best if you could give us some sample file to reproduce it. There could be problem about return statement outside of function body (already reported). So please try it and simply reopen this issue. Thanks for reporting Product Version: NetBeans IDE 7.3 (Build 201302132200) Java: 1.7.0_21; Java HotSpot(TM) Client VM 23.21-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11 System: Linux version 3.2.0-40-generic-pae running on i386; UTF-8; en_US (nb)
Created attachment 133458 [details] Sample file Here is a sample file with the error. I am using the latest Netbeans version. For the context, this function is used inside a PHP class. Thank you for any feedback. :)
Created attachment 133462 [details] simplified sample file Thanks for the sample, I tried to simplify it a bit but it is quite mixed code so hopefully I didn't break the JS code. I also noticed that if I remove all code from line 29 to 37, the error is gone while the removed JS code in these lines shouldn't trigger this change. Product Version: NetBeans IDE Dev (Build web-main-10285-on-20130411) Java: 1.7.0_21; Java HotSpot(TM) Client VM 23.21-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11 System: Linux version 3.2.0-40-generic-pae running on i386; UTF-8; en_US (nb)
Fixed by fix for #233066.