`spl_object_hash` can not be trusted like that. It can re-issue the same id when an object looses scope. 

What exactly rubs you so wrong about the approach I chose? I even did the refactoring you asked for (I agree it's more readable this way), but overall we are talking about the *internal* workings of a method which was buggy and *now* does what it's supposed to do and is tested accordingly.