Skip to content

Removed ambiguous behavior from getIterator

Compare
Choose a tag to compare
@TemirkhanN TemirkhanN released this 14 Apr 21:26
· 3 commits to master since this release

Previously iterator returned Traversable for map and collection.

Phpstorm and Phpstan can resolve it correctly though IDE will still think that type is either the declared one or something else.

Since php is dumb and handles differently array<type> and Traversable<type> we have to declare that Traversable always has an array key as Traversable<array-key, type>