Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78425 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56049 invoked from network); 28 Oct 2014 14:04:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Oct 2014 14:04:18 -0000 Authentication-Results: pb1.pair.com header.from=php@beccati.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php@beccati.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain beccati.com designates 176.9.114.167 as permitted sender) X-PHP-List-Original-Sender: php@beccati.com X-Host-Fingerprint: 176.9.114.167 spritz.beccati.com Received: from [176.9.114.167] ([176.9.114.167:42234] helo=mail.beccati.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/05-21571-F52AF445 for ; Tue, 28 Oct 2014 09:04:16 -0500 Received: (qmail 20172 invoked from network); 28 Oct 2014 14:04:10 -0000 Received: from home.beccati.com (HELO ?192.168.1.202?) (88.149.176.119) by mail.beccati.com with SMTP; 28 Oct 2014 14:04:10 -0000 Message-ID: <544FA255.7030609@beccati.com> Date: Tue, 28 Oct 2014 15:04:05 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Stas Malyshev CC: Etienne Kneuss , PHP Internals References: <544DA1CD.9070109@php.net> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Using objects as keys From: php@beccati.com (Matteo Beccati) Hi Stas, On 27/10/2014 18:39, Etienne Kneuss wrote: > I think it should be made clear that what the target of your RFC is not to > support objects as keys, what you propose instead is an implicit > translation from: > > $a[$obj] > to > $a[$obj->__hash()] > > This is clearly different. I agree the RFC should make it very clear that foreach, key(), array_keys(), etc. will just return the hash, not the object instance. I for one was a bit confused and couldn't tell if that was the case after reading the entire RFC. Cheers -- Matteo Beccati Development & Consulting - http://www.beccati.com/