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
(https://phpstan.org/r/183caf26-e741-46be-b8ab-b93af9f082aa)
No error, the array should be considered as array{foo?: int, bar?: int}
array{foo?: int, bar?: int}
Sure
The text was updated successfully, but these errors were encountered:
Similar issue https://phpstan.org/r/74a8382c-f6bf-4fca-a378-100ca2568cae
The array is inferred as array{bar: int<min, -1>, foo: int<1, max>} but foo and bar can never be set in the same time.
Same issue with if/else: https://phpstan.org/r/4941e906-0ee4-462c-9aa7-93c98a9772d7
I can also try to fix it, if you have an idea where I should look @ondrejmirtes
Sorry, something went wrong.
@VincentLanglet After the latest commit in 1.6.x, PHPStan now reports different result with your code snippet:
@@ @@ -20: Offset 'foo' on array{bar: int<min, 0>, foo: int<1, max>} in isset() always exists and is not nullable. +No errors
@@ @@ -21: Offset 'foo' on array{bar: int<min, -1>, foo: int<1, max>} in isset() always exists and is not nullable. +No errors
Successfully merging a pull request may close this issue.
Bug report
Code snippet that reproduces the problem
(https://phpstan.org/r/183caf26-e741-46be-b8ab-b93af9f082aa)
Expected output
No error, the array should be considered as
array{foo?: int, bar?: int}
Did PHPStan help you today? Did it make you happy in any way?
Sure
The text was updated successfully, but these errors were encountered: