allow $isOffsetAccessible->maybe() for isUndefinedExpressionAllowed and isSpecified expression#1312
Conversation
…or isSpecified expression
…(even they are valid)
This reverts commit 7770a18.
!$isOffsetAccessible->yes() for isUndefinedExpressionAllowed …$isOffsetAccessible->maybe() for isUndefinedExpressionAllowed and isSpecified expression
|
I think I understood it. |
There was a problem hiding this comment.
No, I just wanted to change this line to some kind of function call that doesn’t cause isUndefinedExpressionAllowed === true (that means something except isset, unset, empty)
There was a problem hiding this comment.
Please add new code instead of changing existing tests :) Thanks.
|
@ondrejmirtes This change can make this code not report, and I believe this shouldn't be reported because this is a valid PHP code.
Although, I remembered now this issue phpstan/phpstan#7073 and noticed that I have to be careful for array access on object type (because it is a fatal error) and this PR needs some modification anyway. |
|
All of that is totally fine, I just want both unset and var_dump tested in that file. It's OK if the error for unset() changes/disappears. |
|
I see, thanks. |
|
https://3v4l.org/HrulF |
|
@ondrejmirtes I will implement a more strict behavior for memo |
|
Thank you! |
fixes phpstan/phpstan#7229