Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Mar 11, 2025

@staabm staabm marked this pull request as ready for review March 11, 2025 15:38
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes ondrejmirtes merged commit 39c65a9 into phpstan:2.1.x Mar 11, 2025
416 of 418 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the bug12406 branch March 11, 2025 15:42
@ondrejmirtes
Copy link
Member

I'm sorry I'm supplying you with so much work today 😊 This PR causes these false positives: https://phpstan.org/r/deb8f749-5ef2-41cd-ba7b-e3039a8f692c

@staabm
Copy link
Contributor Author

staabm commented Mar 21, 2025

I had not yet a idea how to fix it.
adding some debug statements it seems the problem is, that the loop analysis already knows all offsets the array will have in the end and the first assignment already assigns the array with all offsets

https://phpstan.org/r/ce5a357e-f957-407a-b173-96ea59652144

I will be AFK until later today or tomorrow and cannot look further into it right now

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.

reportPossiblyNonexistentGeneralArrayOffset after assigning an array key Optional key narrowing in array shape breaks during nested access

3 participants