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

Parameter #4 $replacement of function array_splice expects array|string #6288

Closed
spawnia opened this issue Jan 2, 2022 · 2 comments · Fixed by phpstan/phpstan-src#901
Closed

Comments

@spawnia
Copy link

spawnia commented Jan 2, 2022

Bug report

Parameter #4 $replacement of array_splice() is reported as array|string, it should be mixed through, see https://www.php.net/manual/en/function.array-splice.php

Code snippet that reproduces the problem

https://phpstan.org/r/47c75bff-cfa4-417c-b4dc-070d23b46d89

Expected output

No error, the code snippet works as expected: https://3v4l.org/aieOR

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

It allowed me to delete around 200 lines of redundant code.

@herndlm
Copy link
Contributor

herndlm commented Jan 2, 2022

If you want to fix this yourself - https://github.com/phpstan/phpstan-src/blob/master/resources/functionMap.php#L305 should be the place to look at

@github-actions
Copy link

github-actions bot commented Mar 5, 2022

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 Mar 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants