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 151396 - Accidental Assignment Warning
Summary: Accidental Assignment Warning
Status: VERIFIED DUPLICATE of bug 147259
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomasz Slota
Depends on:
Reported: 2008-10-26 14:52 UTC by compucoder
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 compucoder 2008-10-26 14:52:48 UTC
I think you need to enhance the rules that determine if this is a warning or not. The concept is great and will save
people a lot of debugging headaches but I think it can be made more intelligent. For example if you have this code:

if(!$result = $db->query($query))
   throw new DBQueryFailure("DB Query failed in method [".__FUNCTION__."] in class [".__CLASS__."]\n", $db->errno,

    return true;

I can see this throwing a warning because there is no way of distinguising they know what they were doing, but if you
have this:

  	if(!($result = $db->query($query)))
  		throw new DBQueryFailure("DB Query failed in method [".__FUNCTION__."] in class [".__CLASS__."]\n", $db->errno,

    return true;

You can see they know what they are doing, they have the assignment enclosed in brackets. I think you should add in a
check to your accidental assignment code to test if they do have brackets around the assignment. if so then the warning
should be removed. You should do this for all copnstructs that can do tests like if, while, do while, for, foreach.

I believe Zend Studio has tests in place to do exactly what I state above and remove their warning.

Comment 1 Tomasz Slota 2008-10-27 15:32:26 UTC

*** This issue has been marked as a duplicate of 147259 ***
Comment 2 Mikhail Matveev 2008-10-27 15:44:39 UTC
Verified duplicate