Skip to content

non-empty-array might be empty after array_keys() with filter#4295

Merged
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
staabm:bug13377
Sep 8, 2025
Merged

non-empty-array might be empty after array_keys() with filter#4295
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
staabm:bug13377

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Sep 7, 2025

@staabm staabm marked this pull request as ready for review September 7, 2025 18:36
@phpstan-bot
Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

Copy link
Copy Markdown
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AccessoryArrayListType might have the same problem, can you try to reproduce it and fix it? Thanks.

@staabm
Copy link
Copy Markdown
Contributor Author

staabm commented Sep 8, 2025

AccessoryArrayListType might have the same problem, can you try to reproduce it and fix it?

when using a filter array_keys still returns a list, see https://3v4l.org/LCT5q

@ondrejmirtes
Copy link
Copy Markdown
Member

Oh, of course 😊

@ondrejmirtes ondrejmirtes merged commit 9298ddc into phpstan:2.1.x Sep 8, 2025
444 of 457 checks passed
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

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.

array_keys() with filter treated as non-empty array after not empty source array check

3 participants