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.
In the current development build of netbeans with enabled warnings for unused variables I found a little bug: If a variable is defined and used as object the usage isn't recognized and a warning is shown: foreach ($list as $item) { $item->field = "test"; } In this case a warning is shown that $item is not used, but it is. The same happens when you use a variable as index of an associative array: foreach ($list as $key => $value) { $list2[$key] = "test"; } Here $key will be marked with the warning that it isn't used.
confirmed
*** Issue 155847 has been marked as a duplicate of this issue. ***
*** Issue 156415 has been marked as a duplicate of this issue. ***
experimental hints -> P4
reassigning to default owner
batch reassigning
A similar problem can be seen (in version 7.0) in a slightly different setup: Example: if (count($nameParts) >= 2) { $groupIndex = intval($nameParts[1]); $subjects[$groupIndex]['subjects'] = True; } Here the use of $groupIndex in the third line is not recognised and the hint is displayed. I hope it's OK to add this note here. If it's a completely different issue, please let me know and I'll file a separate report for it.
Batch reassigning.
*** This bug has been marked as a duplicate of bug 170541 ***