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

Summary: Turn off accidental assignment warning if comparison exists
Product: php Reporter: Mikhail Matveev <mikhailmatveev>
Component: EditorAssignee: Tomasz Slota <tslota>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

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

http://hg.netbeans.org/main/rev/faebbc45c64
Comment 7 Quality Engineering 2008-12-01 17:04:35 UTC
Integrated into 'main-golden', will be available in build *200812011401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/faebbc45c644
User: Tomasz Slota <tslota@netbeans.org>
Log: #147259: turn off accidental assignment warning if comparison exists
Comment 8 Mikhail Matveev 2008-12-02 16:07:59 UTC
Verified