Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow negated assignment in else #10

Closed
muglug opened this issue Dec 9, 2016 · 0 comments
Closed

Allow negated assignment in else #10

muglug opened this issue Dec 9, 2016 · 0 comments
Labels

Comments

@muglug
Copy link
Collaborator

muglug commented Dec 9, 2016

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.

@muglug muglug added the bug label Dec 9, 2016
@muglug muglug changed the title Allow negated assignment Allow negated assignment in else Dec 13, 2016
@muglug muglug closed this as completed in 797875b Dec 28, 2016
muglug added a commit that referenced this issue Dec 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant