Re: [RFC][VOTE] Objects as Keys

From: Date: Thu, 18 Dec 2014 10:03:00 +0000
Subject: Re: [RFC][VOTE] Objects as Keys
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14  Groups: php.internals 
Request: Send a blank email to internals+get-79803@lists.php.net to get a copy of this message
On 18/12/14 09:03, Stanislav Malyshev wrote: >> Luckily, we have SplObjectStorage, which maybe makes that rather less >> > urgent as well. > SplObjectStorage doesn't do this - SplObjectStorage uses objects' > identity, which means two GMP(1)'s are different objects. Silly question time again ... What 'precisely' is the problem that 'Objects as keys' is trying to solve? I think what I am asking is just how should a 'modern' design using OO actually build a multidimentional array of objects? What I am currently doing is building a conventional array of which one element is the attached object. Other elements of the array include the primary key and other data useful for sorting the order along with identifying cross links to other objects. I can get to the underlying object just by looking up the primary key in the array. Where does SplObjectStorage fit into this, and more important how does creating a new object fit in with adding it as a key in an array. I need the handle to the object and I ideally I need to know what is in the object so I seem to be missing something. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

« previous php.internals (#79803) next »