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 269093 - NB incorrectly flags array index variable using curly braces as unused within scope
Summary: NB incorrectly flags array index variable using curly braces as unused within...
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-23 15:25 UTC by jnm
Modified: 2016-11-23 15:25 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jnm 2016-11-23 15:25:16 UTC
I have a short function ... and it tags "$error" as unused, whilst it is used within the string ${error['index']} construct

function getErrorString($errorList) {
    $str = "";
    foreach ($errorList as $error) {
        $str .= "[errno ${error['errno']}]\n";
    }
    return $str;
}

It appears to be that indexed variables in conjunction wiht the ${...} construct provokes the problem.

Just using $error works as expected (no hint), as does ${error} and $error[1].  But ${error[1]} provokes it to be shown.