Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77603 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20821 invoked from network); 25 Sep 2014 05:19:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Sep 2014 05:19:49 -0000 Authentication-Results: pb1.pair.com header.from=php@bof.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php@bof.de; spf=pass; 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:43274] helo=mars.intermailgate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0F/41-06184-4F5A3245 for ; Thu, 25 Sep 2014 01:19:49 -0400 Received: (qmail 20350 invoked by uid 1009); 25 Sep 2014 07:19:45 +0200 Received: from 209.85.192.50 by mars (envelope-from , uid 89) with qmail-scanner-1.25-st-qms (clamdscan: 0.96.2/19429. spamassassin: 3.3.1. perlscan: 1.25-st-qms. Clear:RC:1(209.85.192.50):. Processed in 0.099133 secs); 25 Sep 2014 05:19:45 -0000 X-Antivirus-MYDOMAIN-Mail-From: php@bof.de via mars X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:1(209.85.192.50):. Processed in 0.099133 secs Process 20317) Received: from mail-qg0-f50.google.com (gmail@bof.de@209.85.192.50) by mars.intermailgate.com with RC4-SHA encrypted SMTP; 25 Sep 2014 07:19:45 +0200 Received: by mail-qg0-f50.google.com with SMTP id q107so6928622qgd.37 for ; Wed, 24 Sep 2014 22:19:43 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.140.40.84 with SMTP id w78mr16461194qgw.87.1411622383498; Wed, 24 Sep 2014 22:19:43 -0700 (PDT) Received: by 10.140.86.112 with HTTP; Wed, 24 Sep 2014 22:19:43 -0700 (PDT) Received: by 10.140.86.112 with HTTP; Wed, 24 Sep 2014 22:19:43 -0700 (PDT) In-Reply-To: <3E4C58C8-E816-4798-9D8F-2C7EFFA28438@ajf.me> References: <1411561476.2303.4.camel@guybrush> <54232205.4020806@sugarcrm.com> <3E4C58C8-E816-4798-9D8F-2C7EFFA28438@ajf.me> Date: Thu, 25 Sep 2014 07:19:43 +0200 Message-ID: To: Andrea Faulds Cc: internals , Nicolai Scheer , =?UTF-8?Q?Johannes_Schl=C3=BCter?= , Stas Malyshev Content-Type: multipart/alternative; boundary=001a11c122bab9bd8a0503dcf281 Subject: Re: [PHP-DEV] Invokation on __toString() for object used as array key From: php@bof.de (Patrick Schaaf) --001a11c122bab9bd8a0503dcf281 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 24.09.2014 22:01 schrieb "Andrea Faulds" : > > Now, if we were to add actual object key support, that I might like. But if we=E2=80=99re going to keep with just integers and strings, I=E2=80=99d = much prefer to just support __toString here. I think users are smart enough to understand that PHP arrays only have string or int keys, so it casts to a string. Once you do that - automatically use __toString on objects used as keys, the way to full object key support in the future, is completely blocked, because BC. I'd much more like to see full object key support, with spl_object_hash or a magic __hash() method only used to determine hash slot position internally. best regards Patrick --001a11c122bab9bd8a0503dcf281--