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.

Bug 147259 - Turn off accidental assignment warning if comparison exists
Summary: Turn off accidental assignment warning if comparison exists
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 2 votes (vote)
Assignee: Tomasz Slota
: 151396 (view as bug list)
Depends on:
Reported: 2008-09-15 12:31 UTC by Mikhail Matveev
Modified: 2009-02-19 22:52 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Matveev 2008-09-15 12:31:08 UTC
In situation like 

while (($f = mysql_fetch_assoc($res)) != NULL)

possible accidental assignment warning shouldn't appear.
Comment 1 Tomasz Slota 2008-09-15 12:34:41 UTC
I don't think comparison is a good criteria for switching it off, such code is still dangerous. It should be possible to switch this warning off for the while statement 

*** This issue has been marked as a duplicate of 142797 ***
Comment 2 Mikhail Matveev 2008-09-15 12:41:58 UTC
It's not a duplicate of 142797. We can use same code with if.
Also, here is a user note (who initially reported the issue): 

> I do know I can turn that off but it's saved me more than once from using A=B when I meant A==B.

If you still think that it's not a good idea, please close the issue as WONTFIX.
Comment 3 nvarun 2008-09-15 15:24:18 UTC
I second that, I have voted for this issue!
Comment 4 Tomasz Slota 2008-10-27 15:31:23 UTC
Upgrading to a P2 defect due to multiple user requests
Comment 5 Tomasz Slota 2008-10-27 15:32:25 UTC
*** Issue 151396 has been marked as a duplicate of this issue. ***
Comment 6 Tomasz Slota 2008-11-30 21:17:21 UTC
fixed by adding hint cfg option: "Ignore assignments in sub-statements", which is now on by default
Comment 7 Quality Engineering 2008-12-01 17:04:35 UTC
Integrated into 'main-golden', will be available in build *200812011401* on (upload may still be in progress)
User: Tomasz Slota <>
Log: #147259: turn off accidental assignment warning if comparison exists
Comment 8 Mikhail Matveev 2008-12-02 16:07:59 UTC