icecave / collections

A PHP collection library loosely inspired by the .NET runtime and the C++ STL. [DEPRECATED]
MIT License
70 stars 2 forks source link

Set allows adding of multiple objects that are be Parity::compare($a, $b) === 0. #65

Closed jmalloc closed 10 years ago

jmalloc commented 10 years ago

I was trying adding sets of strings to a set in mason.

jmalloc commented 10 years ago

Probably related to object identity comparison, but check on whether Parity should be using it's own compare methods where supported.

jmalloc commented 10 years ago

Ok, so this was intentional it seems. Set uses a custom ObjectIdentityComparator that ensures that objects are ALWAYS compared by identity. In hindsight this was probably a mistake but it's a BC issue. I'll create a new issue to change this in 2.0.