Re: [RFC][VOTE] Objects as Keys

From: Date: Wed, 17 Dec 2014 01:28:02 +0000
Subject: Re: [RFC][VOTE] Objects as Keys
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-79761@lists.php.net to get a copy of this message
guilhermeblanco@gmail.com wrote: > On Tue, Dec 16, 2014 at 9:39 AM, Matteo Beccati <php@beccati.com> > wrote: > >> Are you sure you haven't misinterpreted the RFC? > > I did not. You may think I mentioned IdentityMap as entity map, but I'm > talking about entityPersister mapping or resultPointers consumptions that > happens inside Doctrine throughout the execution. Entity IdentityMap is > enough to use purely spl_object_hash(). We should focus on the main goal > here, which is complex structures as keys. > > As a very complex library developer I do see lots of use cases for this. AIUI, this RFC is meant to introduce some sugar only. Wouldn't it be possible to have object hashes without __hash(), by introducing a respective interface (maybe "Hashable" or "Identifiable") and requiring the appropriate classes to implement this interface? -- Christoph M. Becker

« previous php.internals (#79761) next »