Skip to content

Variable variables are considered unused on assignment left-hand side #84

@loilo

Description

@loilo

Variable variables are considered unused when only appearing on the left-hand side of an assignment.

This is considered fine:

function fn()
{
    $foo = true;
    $var = 'foo';
    return $$var;
}

While this says $var is unused:

function fn()
{
    $foo = true;
    $var = 'foo';
    $$var = false;
}

($foo is marked unused in both cases, but I guess there's no way to avoid that without deeper program flow analysis.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions