Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78485 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7525 invoked from network); 30 Oct 2014 19:59:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Oct 2014 19:59:28 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.123 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.123 smtp123.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.123] ([108.166.43.123:40964] helo=smtp123.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/B0-04091-F9892545 for ; Thu, 30 Oct 2014 14:59:28 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp24.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 8BE938046E; Thu, 30 Oct 2014 15:59:25 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp24.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 33D1B8040C; Thu, 30 Oct 2014 15:59:25 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local ([UNAVAILABLE]. [74.85.23.222]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.3.2); Thu, 30 Oct 2014 19:59:25 GMT Message-ID: <5452989C.5090604@sugarcrm.com> Date: Thu, 30 Oct 2014 12:59:24 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Will Fitch CC: Larry Garfield , "internals@lists.php.net" References: <544DA1CD.9070109@php.net> <4ED7146272E04A47B986ED49E771E347BD7E35E061@Ikarus.ameusgmbh.intern> <51CF9ADE-2E04-4BC0-9E5C-B93498251F59@php.net> <54527E7E.2020505@garfieldtech.com> <54528445.8080604@sugarcrm.com> <69356D8D-44FB-411F-907D-94B61D4A472A@fastmail.fm> In-Reply-To: <69356D8D-44FB-411F-907D-94B61D4A472A@fastmail.fm> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Using objects as keys From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > My only concern at this point is the default value of the hash. If we > were to use spl _object_hash, we could be setting a precedence that a > hash must be unique to each object. I don't think there should be any default value. Most objects are not suitable as keys, only some of them are (they must be immutable and have easily derived identity). So the default is to not allow it for arbitrary object. The programmer should specially designate the objects to be suitable for hashing by creating the hash function - and there the suitable function can be used, spl_object_hash or stringification or anything else, depending on the actual case. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/