SO,
The problem
It\'s not well-known, but PHP allows to compare objects - and not just on equality ==
- but on <
PHP compares sequentially (in the order of declaration) the object properties and stops at the first inequal property found. This behavior is not documented, so there's not much to be said about it, sadly, other than looking at the source of PHP.
Not documented is usually a synonym of "don't rely on it".