Skip to content

False positive for unused/undefined variable in arrow function when used inside double quotes #220

Closed
@ocean90

Description

@ocean90

See the following example:

$allowed_extensions = array_map( fn( $extension ) => ".$extension", $allowed_extensions );

// Unused function parameter $extension. (VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable)
// Variable $extension is undefined. (VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable)

Fwiw, the same doesn't happen when using a closure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions