Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78382 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24221 invoked from network); 27 Oct 2014 09:05:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2014 09:05:44 -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:36146] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/1B-56216-6EA0E445 for ; Mon, 27 Oct 2014 04:05:43 -0500 Received: (qmail 20197 invoked by uid 89); 27 Oct 2014 09:05:39 -0000 Received: by simscan 1.3.1 ppid: 20187, pid: 20193, t: 0.2532s 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.163.79.60) by mail4.serversure.net with ESMTPA; 27 Oct 2014 09:05:39 -0000 Message-ID: <544E0AE1.9090406@lsces.co.uk> Date: Mon, 27 Oct 2014 09:05:37 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: internals@lists.php.net References: <544DA1CD.9070109@php.net> In-Reply-To: <544DA1CD.9070109@php.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Using objects as keys From: lester@lsces.co.uk (Lester Caine) On 27/10/14 01:37, Stas Malyshev wrote: > The name __hash is not final, I am open to using __toKey instead or any > reasonable alternative, we may also include a couple of options in the > vote if that will be a point of disagreement. I don't think it's clear from the RFC ... Is the resulting value intended always to return the same object independent of what has been done to the object in the mean time? A fixed 'address' for the physical data when used as an array key? If that is the case, then __toKey seems more comfortable. To me a hash is used to establish if the item I am looking at has changed since it was last accessed. There are two use cases compare the contents are the same, and access the same object later even if it has been updated. That said, the EKey value IS intended to identify objects which have changed since last being accessed ... so you can't win either way? -- 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