Shouldn't this be avoided? This relies on PHP's internal "magic" to compare objects.