Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79310 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63410 invoked from network); 29 Nov 2014 18:04:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Nov 2014 18:04:06 -0000 Authentication-Results: pb1.pair.com header.from=bostjan@a2o.si; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bostjan@a2o.si; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain a2o.si designates 78.47.12.76 as permitted sender) X-PHP-List-Original-Sender: bostjan@a2o.si X-Host-Fingerprint: 78.47.12.76 portkey.s.itsis.si Received: from [78.47.12.76] ([78.47.12.76:55371] helo=portkey.s.itsis.si) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/00-62697-59A0A745 for ; Sat, 29 Nov 2014 13:04:06 -0500 Received: from undisclosed (undisclosed [127.0.0.254]) (Authenticated sender: undisclosed) by portkey.s.itsis.si (Postfix) with ESMTPSA id 23FD180069 for ; Sat, 29 Nov 2014 18:04:01 +0000 (UTC) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.98.4 at portkey Received: by mail-ig0-f177.google.com with SMTP id z20so6953649igj.4 for ; Sat, 29 Nov 2014 10:04:00 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.43.128.71 with SMTP id hd7mr46812239icc.36.1417284240208; Sat, 29 Nov 2014 10:04:00 -0800 (PST) Received: by 10.50.35.1 with HTTP; Sat, 29 Nov 2014 10:04:00 -0800 (PST) In-Reply-To: <5479038D.8070700@gmail.com> References: <5479038D.8070700@gmail.com> Date: Sat, 29 Nov 2014 19:04:00 +0100 Message-ID: To: Rowan Collins Cc: PHP Internals List Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle() From: bostjan@a2o.si (Bostjan Skufca) On 29 November 2014 at 00:21, Rowan Collins wrote: > On 28/11/2014 01:13, Bostjan Skufca wrote: >> >> A function called spl_object_hash() exists, >> but it returns identical hashes for equal objects. > > In case it's been lost in the noise, no it doesn't. Ouch. I am terribly sorry about this mistake, it really does not. However, having word "hash" in the function name suggests that returned hash is generated by the object's contents, too. I just noticed that the first comment explains that this is not the case, which I confirmed with additional testing. To quote a part of first sentence of Wikipedia on "Hash function": "...with slight differences in input data producing very big differences in output data." So, to sum it up: spl_object_hash indeed does what I initially required, but I was mislead by the "hash" word in its name, and the environment where I was trying to use it (unable to bring two object references in the same place easily). But I would maybe suggest changing the name to spl_object_id (and keeping ..._hash alias for backward compatibility). b.