Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Strict iterator_to_array, do not overwite duplicate keys #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lookyman wants to merge 1 commit into phpstan:master from lookyman:iterator-to-array-strict

Conversation

@lookyman
Copy link
Contributor

@lookyman lookyman commented Apr 12, 2018

This has shot us in a foot a couple times, especially when yielding from an inner generator inside a generator.

@lookyman lookyman force-pushed the iterator-to-array-strict branch from ef63534 to 533f578 Compare April 12, 2018 13:10
@lookyman lookyman force-pushed the iterator-to-array-strict branch from 533f578 to ce5460e Compare April 12, 2018 13:22
Copy link
Contributor

Doesn't really make sense to me. This would effectively kill ALL maps and first class collections. 👎 from me.

Copy link
Contributor Author

Hmm now that I think about it, this is actually trickier than I thought. You don't lose the items, but you do lose the keys, which might be important. Thank you @Majkl578!

Copy link
Contributor

Majkl578 commented Apr 12, 2018
edited
Loading

You definitely lose keys and you may lose items if there are duplicate keys (then last one wins). But generally this is similar i.e. to array_merge() or +. :)

Copy link
Member

Agreed, closing this 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /