Skip to content

Allow negated assignment in else #10

@muglug

Description

@muglug

TypeTest::testNegatedAssignmentInIf():

if (!($row = (rand(0, 10) ? [5] : null))) {
    // do nothing
}  else {
    echo $row[0];
}

This code emits a MixedArrayOffset issue because the type the if condition evaluates to empty, and negating empty produces mixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions