Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79807 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12722 invoked from network); 18 Dec 2014 14:52:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Dec 2014 14:52:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.20 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.20 mout.gmx.net Received: from [212.227.17.20] ([212.227.17.20:54863] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/13-21720-34AE2945 for ; Thu, 18 Dec 2014 09:52:52 -0500 Received: from [192.168.0.101] ([91.67.244.80]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MGRhs-1Y60991WBE-00DJz9; Thu, 18 Dec 2014 15:52:39 +0100 Message-ID: <5492EA3B.7020903@gmx.de> Date: Thu, 18 Dec 2014 15:52:43 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Lester Caine , 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> <5492A654.3000503@lsces.co.uk> In-Reply-To: <5492A654.3000503@lsces.co.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:xjfd30+Re5XEFy0xNpn1wp21TYrOc8KgwhotyirBcn9+ZQANexI niiJcjodTwGnK3fXb8FqiKXbfQkMdJRrwhHniH74taCeeNv91yxYANz/JjT7HUzyQPskYeS 2KYUKNdUO++WelDpBi8nee1KHWPVga8w6J1ZMZ1o84f9UaH/8O2RCK3FGiVRp8uyWil6VdT ikOPpTTXvVP2UUkiC34kw== X-UI-Out-Filterresults: notjunk:1; Subject: Re: [PHP-DEV] [RFC][VOTE] Objects as Keys From: cmbecker69@gmx.de (Christoph Becker) 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: . > 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-general@lists.php.net. -- Christoph M. Becker