Skip to content

Conversation

@rajyan
Copy link
Contributor

@rajyan rajyan commented May 25, 2022

fixes phpstan/phpstan#7318

Currently isset with

$arr[maybe][yes]

is working, but

$arr[maybe][yes][yes]

is not.

For $hasOffsetValue->yes() check, we have to recursively check until ArrayDImFetch ends.

Same thing can happen with

$arr[no][yes][yes]

but I believe I cant make this example, because if the first offset access is $hasOffsetValue->no(), the subsequent offset would be $hasOffsetValue->no() too.

@rajyan rajyan marked this pull request as ready for review May 26, 2022 00:01
@rajyan rajyan marked this pull request as draft May 26, 2022 00:07
@rajyan rajyan marked this pull request as ready for review May 26, 2022 00:10
@ondrejmirtes ondrejmirtes merged commit 0b7527a into phpstan:1.7.x May 26, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@rajyan rajyan deleted the fix/issue-7318 branch May 26, 2022 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug with isset / ??

2 participants