Skip to content

Inline if-clause with short-list false positive #263

Closed
@sybrew

Description

@sybrew

Hello!

False-positive:

if ( true )
	[ $a ] = [ 'hi' ]; // VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable

return $a ?? ''; // VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable

Fine:

if ( true ) {
	[ $a ] = [ 'hi' ];
}
return $a ?? '';

Also fine:

if ( true )
	list( $a ) = [ 'hi' ];

return $a ?? '';

I don't think there's any more info to add. Cheers 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions