Skip to content

Conversation

paulbalandan
Copy link
Contributor

Generators allow any type for its keys. When passed to iterator_to_array(), the keys are coerced to string or int where possible. For non-scalar keys, the function throws.

Current PHPStan behaviour: https://phpstan.org/r/2489fc17-69f8-4e75-894a-48e9cb1b211f
Expected behaviours:

@paulbalandan paulbalandan force-pushed the iterator-to-array-generators branch from 5e0a2a6 to d77b63f Compare November 29, 2024 17:15
@ondrejmirtes ondrejmirtes merged commit 25d712e into phpstan:1.12.x Nov 30, 2024
452 checks passed
@ondrejmirtes
Copy link
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.

2 participants