Lester Caine wrote: > 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?
Stas explained that in a blog post: <http://php100.wordpress.com/2014/12/14/objects-as-keys/>. > 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. IMHO that is better asked and discussed on php-gene...@lists.php.net. -- Christoph M. Becker -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php