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

Appending to a list should maintain list #15966

Open
mvorisek opened this issue Sep 20, 2024 · 1 comment
Open

Appending to a list should maintain list #15966

mvorisek opened this issue Sep 20, 2024 · 1 comment

Comments

@mvorisek
Copy link
Contributor

Description

repro: https://3v4l.org/fV80Z

I know historically there is internal "next free index variable", but array with 0...n-1 keys should stay list even when some key/value is added. using [] operator.

Related with phpstan/phpstan#11628 as array_is_list($v) should imply list and such list must maintain list behaviour when value is appended/unset to/from the end.

@nielsdos
Copy link
Member

This is a behaviour change with possible BC concerns. Therefore this needs an RFC.

@nielsdos nielsdos changed the title Appending a to list should maintain list Appending to a list should maintain list Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants