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

Fix array_is_list call after unset #3400

Closed
wants to merge 2 commits into from

Conversation

VincentLanglet
Copy link
Contributor

@VincentLanglet VincentLanglet commented Sep 4, 2024

Extracted from #3381

It may be surprising but the code

$a = [1, 2, 3];
unset($a[2]);

var_dump(array_is_list($a));

display TRUE.

As shown in the example https://3v4l.org/0HFeL

So I updated ConstantArrayType::unsetOffsetType()
and ConstantArrayTypeBuilder::setOffsetValueType()

Edit: But I feel like this bugfix might not enough like shown by the latest added test 61b6160
=> See https://3v4l.org/XX2fU for the PHP behavior.

So maybe the fix should be done differently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant