Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79803 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93271 invoked from network); 18 Dec 2014 10:03:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Dec 2014 10:03:07 -0000 Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.214 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.214 mail4-2.serversure.net Linux 2.6 Received: from [217.147.176.214] ([217.147.176.214:44983] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/F0-21720-756A2945 for ; Thu, 18 Dec 2014 05:03:05 -0500 Received: (qmail 17926 invoked by uid 89); 18 Dec 2014 10:03:01 -0000 Received: by simscan 1.3.1 ppid: 17913, pid: 17919, t: 0.1022s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.8?) (lester@rainbowdigitalmedia.org.uk@86.178.188.220) by mail4.serversure.net with ESMTPA; 18 Dec 2014 10:03:01 -0000 Message-ID: <5492A654.3000503@lsces.co.uk> Date: Thu, 18 Dec 2014 10:03:00 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: internals@lists.php.net References: <548FEE87.7020602@gmail.com> <549009EE.7040808@fischer.name> <54907683.2070509@gmail.com> <8AB6896C-D5DB-4471-BBD5-60784B2FC1BE@gmail.com> <54907EDE.6020500@gmail.com> <4E4F7392-154C-4282-8D5D-553194D09DCE@gmail.com> <5490DC22.2080605@gmx.de> <5490DD19.2080502@gmail.com> <5490E226.3070202@gmx.de> <5490E6F2.4050109@gmail.com> <549166B7.2030003@gmail.com> <54929864.50105@gmail.com> In-Reply-To: <54929864.50105@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC][VOTE] Objects as Keys From: lester@lsces.co.uk (Lester Caine) 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