Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77615 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44488 invoked from network); 25 Sep 2014 08:21:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Sep 2014 08:21:46 -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:55615] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/C5-06184-990D3245 for ; Thu, 25 Sep 2014 04:21:46 -0400 Received: (qmail 15041 invoked by uid 89); 25 Sep 2014 08:21:42 -0000 Received: by simscan 1.3.1 ppid: 15035, pid: 15038, t: 0.0798s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.8?) (lester@rainbowdigitalmedia.org.uk@81.138.11.136) by mail4.serversure.net with ESMTPA; 25 Sep 2014 08:21:42 -0000 Message-ID: <5423D096.9010508@lsces.co.uk> Date: Thu, 25 Sep 2014 09:21:42 +0100 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: <1411561476.2303.4.camel@guybrush> <54232205.4020806@sugarcrm.com> <3E4C58C8-E816-4798-9D8F-2C7EFFA28438@ajf.me> <5423C701.807@lsces.co.uk> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Invokation on __toString() for object used as array key From: lester@lsces.co.uk (Lester Caine) On 25/09/14 08:44, Leigh wrote: > On 25 September 2014 08:40, Lester Caine wrote: >> > >> > Why would we need to build a hash of this object? It would provide >> > nothing of use since we have a clean object key. Some people seem to >> > think a hash will provide an indication that an object has changed, but >> > in reality that is also reliant on what information is imported when the >> > object is loaded. > Nothing to do with when the object is changed. > > http://php.net/spl_object_hash 'This function returns a unique identifier for the object.' There is a mistaken view in some usage that that will be DIFFERENT for different versions of the same object. So what *IS* returned by spl_object_hash? The UCN from 7 years ago flags that the identifier is only based on the internal pointers to the object in memory and that the result is not user friendly, but without digging into the code, the problems such as the fact that re-use of the buffer space by a later object cached in the same buffer may be the same as ID? It is not immediately obvious that using a buffer to load data to build a more compact array would have the SAME spl_object_hash for every entry ... -- 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