Replies: 2 comments 2 replies
-
Could you please also add what you expect the method to return? The method's documentation Collection::class#L289 mentions it retrieving the duplicate items in the collection, which it seems to do in your provided example. It is accounting for one of the items being the original and hence not a duplicate, thus not included. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think the behaviour is expected. If you want unique duplicates you can do: |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
The issue:
collect(['A', 'A', 'B', 'B', 'C', 'C', 'C', 'C', 'D'])->duplicates()->all(); // it returns ['A' , 'B' , 'C', 'C', 'C']
also the duplicatesStrict has this issue too
Beta Was this translation helpful? Give feedback.
All reactions