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

Array shape is lost on array_push with ...splat #7115

Closed
leongersen opened this issue Apr 26, 2022 · 2 comments · Fixed by phpstan/phpstan-src#1247
Closed

Array shape is lost on array_push with ...splat #7115

leongersen opened this issue Apr 26, 2022 · 2 comments · Fixed by phpstan/phpstan-src#1247
Labels
Milestone

Comments

@leongersen
Copy link
Contributor

Bug report

I've reported the very similar #5783 before, which was fixed (thanks!).

In 1.6.0, using array_push with the splat operator loses the array shape for the array. "regular" uses of array_push or $a[] = do not have this issue.

Code snippet that reproduces the problem

https://phpstan.org/r/35e49621-9df6-4eed-960e-e030acc9728e

Expected output

$a, $b and $c all report array<int, array{a: int, b: string}>;

Did PHPStan help you today? Did it make you happy in any way?

I love working with PHPStan. I learn new things everytime!

@ondrejmirtes
Copy link
Member

/cc @herndlm who did phpstan/phpstan-src#1232 :)

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants