We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using array_replace on an existing array with known keys, now the existing keys are only "possible"
array_replace
https://phpstan.org/r/70b1e175-a50d-4521-b4ce-2ffa2aac82d5
array{abc: 'def', hello: 'country'}
Actual output
non-empty-array<'abc'|'hello', 'country'|'def'|'world'>
No response
The text was updated successfully, but these errors were encountered:
Looks like https://github.com/phpstan/phpstan-src/blob/f2f2ddf44425cc58b5b1537ddce7cd06a9bba074/src/Type/Php/ArrayReplaceFunctionReturnTypeExtension.php does not handle constant arrays properly
It uses all input arg arrays without actually doing a replace. Looks like it would need to be rewritten or heavily adapted.
Sorry, something went wrong.
@herndlm I tried to rework the extension based on the ArrayMerge one, if you want to take a look phpstan/phpstan-src#3958
No branches or pull requests
Bug report
When using
array_replace
on an existing array with known keys, now the existing keys are only "possible"Code snippet that reproduces the problem
https://phpstan.org/r/70b1e175-a50d-4521-b4ce-2ffa2aac82d5
Expected output
Actual output
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: