Skip to content

False negative: unused variable which has been changed #111

Closed
@jrfnl

Description

@jrfnl
function foo() {
	$var = 'abc';
	$var = 'def';
	
	$var2  = 'def';
	$var2 .= 'ghi';
	
	$var3  = 10;
	$var3 += 20;
}

For the above code, I would expect three errors for unused variables, one each for $var, $var2 and $var3, but only $var is reported as unused.

Looks like this is related to the use of combined assignment operators.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions