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

False error after array + operator and key assignment #3872

Closed
blankse opened this issue Sep 16, 2020 · 4 comments · Fixed by phpstan/phpstan-src#1657
Closed

False error after array + operator and key assignment #3872

blankse opened this issue Sep 16, 2020 · 4 comments · Fixed by phpstan/phpstan-src#1657
Labels
Milestone

Comments

@blankse
Copy link

blankse commented Sep 16, 2020

Bug report

I have a false error when I use the + operator with an array and afterwards an key assignment.

Code snippet that reproduces the problem

https://phpstan.org/r/8abf5a8e-16f4-4891-aeb8-9dc8a054e20a

Expected output

No error

@ondrejmirtes ondrejmirtes added this to the Easy fixes milestone Sep 16, 2020
@phpstan-bot
Copy link
Contributor

@blankse After the latest commit in dev-master, PHPStan now reports different result with your code snippet:

@@ @@
-11: Offset 'operator' does not exist on array('value' => (int|false)).
+11: Offset 'operator' does not exist on array{value: (int|false)}.
Full report
Line Error
11 `Offset 'operator' does not exist on array{value: (int

@phpstan-bot
Copy link
Contributor

@blankse After the latest push in 1.8.x, PHPStan now reports different result with your code snippet:

@@ @@
-11: Offset 'operator' does not exist on array('value' => (int|false)).
+No errors

@staabm
Copy link
Contributor

staabm commented Aug 29, 2022

on it

@github-actions
Copy link

github-actions bot commented Oct 1, 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 Oct 1, 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.

4 participants