Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79720 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8735 invoked from network); 16 Dec 2014 11:46:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Dec 2014 11:46:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@bof.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@bof.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bof.de designates 80.242.145.70 as permitted sender) X-PHP-List-Original-Sender: php@bof.de X-Host-Fingerprint: 80.242.145.70 mars.intermailgate.com Received: from [80.242.145.70] ([80.242.145.70:41440] helo=mars.intermailgate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/A6-07463-68B10945 for ; Tue, 16 Dec 2014 06:46:15 -0500 Received: (qmail 25090 invoked by uid 1009); 16 Dec 2014 12:46:10 +0100 Received: from 209.85.216.45 by mars (envelope-from , uid 89) with qmail-scanner-1.25-st-qms (clamdscan: 0.96.2/19786. spamassassin: 3.3.1. perlscan: 1.25-st-qms. Clear:RC:1(209.85.216.45):. Processed in 0.259239 secs); 16 Dec 2014 11:46:10 -0000 X-Antivirus-MYDOMAIN-Mail-From: php@bof.de via mars X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:1(209.85.216.45):. Processed in 0.259239 secs Process 25067) Received: from mail-qa0-f45.google.com (gmail@bof.de@209.85.216.45) by mars.intermailgate.com with RC4-SHA encrypted SMTP; 16 Dec 2014 12:46:10 +0100 Received: by mail-qa0-f45.google.com with SMTP id i13so1749475qae.32 for ; Tue, 16 Dec 2014 03:46:08 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.140.22.83 with SMTP id 77mr61030036qgm.19.1418730368780; Tue, 16 Dec 2014 03:46:08 -0800 (PST) Received: by 10.140.37.41 with HTTP; Tue, 16 Dec 2014 03:46:08 -0800 (PST) Received: by 10.140.37.41 with HTTP; Tue, 16 Dec 2014 03:46:08 -0800 (PST) In-Reply-To: <5490190A.6050805@beccati.com> References: <548FEE87.7020602@gmail.com> <549009EE.7040808@fischer.name> <5490190A.6050805@beccati.com> Date: Tue, 16 Dec 2014 12:46:08 +0100 Message-ID: To: Matteo Beccati Cc: Markus Fischer , Andrea Faulds , internals@lists.php.net Content-Type: multipart/alternative; boundary=001a11c11da6a9d630050a53e7f4 Subject: Re: [PHP-DEV] [RFC][VOTE] Objects as Keys From: php@bof.de (Patrick Schaaf) --001a11c11da6a9d630050a53e7f4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 16.12.2014 12:36 schrieb "Matteo Beccati" : > > On 16/12/2014 11:52, Andrea Faulds wrote: >> >> I was previously in favour of this, but it=E2=80=99d prevent actual inde= xing >> by objects in future, and I can=E2=80=99t think of any use cases which a= ren=E2=80=99t >> better solved by explicitly converting to a string/integer. > > That's precisely the same reason why I voted Nay. And I wouldn't have been able to put it down in words better than Andrea did. That was my thought initially, too. But I think it is wrong. If PHP ever gets around to provide objects-themselves-as-array-keys support, it can easily do that 1) only if the object does not have such a __toKey() method, or 2) if the object has one, but it returns the object itself (which is forbidden now by the RFC) best regards Patrick --001a11c11da6a9d630050a53e7f4--