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.
This is a major issue, because if one uses the finally keyword anywhere in the code the complete file is marked as invalid and code completion isn't working in the file itself nor in any files that extend that file. https://wiki.php.net/rfc/finally
*** This bug has been marked as a duplicate of bug 230677 ***
Sorry, have to reopen this one because it's not entirely working as it should. https://wiki.php.net/rfc/finally <?php $db = mysqli_connect(); try { call_some_function($db);//the function may throw exceptions which we can not handle } finally { mysqli_close($db); } The above code is valid but marked as invalid in NetBeans (trunk). I wasn't able to test the following: <?php try { return 2; } finally { echo "this will be called\n"; } //this will never be called echo "you can not see me"; As it's directly marked as error by NetBeans (trunk), but it might be marked as "unreachable code" because of the return, that's something that shouldn't happen (if it happens). Kindest regards
You have to open project properties and switch to use PHP 5.5 version. And don't change meta info, thanks. If you see some issue (the second use case), file a new one. But not sure what you try to tell me, that unreachable statement hint doesn't work with a finally kw? Yep, it's possible. But as I said, it's another issue. Thanks.
I changed the project to PHP 5.5, still the following is marked as error: try {} finally {} This isn't: try {} catch {} finally {} Shall I open another issue for this as well?
Yes, P3 defect, thanks.
Fixed in issue #236865.
Verified. Thanks. Product Version: NetBeans IDE Dev (Build 201310170001) Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08 Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18 System: Windows 7 version 6.1 running on x86; Cp1250; en_US (nb)