Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77523 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87388 invoked from network); 23 Sep 2014 10:53:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2014 10:53:37 -0000 Authentication-Results: pb1.pair.com header.from=florian@margaine.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=florian@margaine.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain margaine.com from 209.85.223.174 cause and error) X-PHP-List-Original-Sender: florian@margaine.com X-Host-Fingerprint: 209.85.223.174 mail-ie0-f174.google.com Received: from [209.85.223.174] ([209.85.223.174:56625] helo=mail-ie0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/6D-09206-F2151245 for ; Tue, 23 Sep 2014 06:53:35 -0400 Received: by mail-ie0-f174.google.com with SMTP id rd18so3878826iec.33 for ; Tue, 23 Sep 2014 03:53:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=qLV1AjCIALlm63cyqFuoyrL4cFNK34QIo/wrn+b1Nv8=; b=TjDAWl6KvBny7ThCBUL8qG9/wtIysNNKi8FYtIEyN747S8NulnIipOkINDagd7z5sV vYSale9Iy3cYDLDkiAvF4WuX9OKzU28CWmhVsQPNfigJzEHNYBjOqNFLLV4P1DQsb75I +IY8Svs6LFAHNAcCrMX5lPPWLHJx55EeeA1p5yHslbCvVKYe89tOjVFxQGFTWerbccjV QVSvTQNY2EOUMs1/W7c9RFTlZ0CGOckmDD6gZ40BBVOGRnxZ0jfYoj3iQaNLdeu+sk60 BnQbFm+ualsyaqdJfRpD7NpSDrCXWS4sMYKvx3vfWiAoHV15iTJ7uaNUc3eaKmCvihPk yb/A== X-Gm-Message-State: ALoCoQmsjeuAhnd5ZLACNalEYMoJNqXkOnOTQlcK0l8nd0QFEBcWjoHC+s6X4JUoAUTM3t9Tb4tj MIME-Version: 1.0 X-Received: by 10.43.0.133 with SMTP id nm5mr1682264icb.55.1411469611876; Tue, 23 Sep 2014 03:53:31 -0700 (PDT) Received: by 10.107.5.194 with HTTP; Tue, 23 Sep 2014 03:53:31 -0700 (PDT) X-Originating-IP: [80.215.160.85] Received: by 10.107.5.194 with HTTP; Tue, 23 Sep 2014 03:53:31 -0700 (PDT) In-Reply-To: <54214E57.3080200@php.net> References: <54213481.8080700@php.net> <54213ECC.5080204@php.net> <54214E57.3080200@php.net> Date: Tue, 23 Sep 2014 12:53:31 +0200 Message-ID: To: Michael Wallner Cc: PHP Internals , Nicolai Scheer , Leigh Content-Type: multipart/alternative; boundary=bcaec50fe063d3e0fd0503b9600d Subject: Re: [PHP-DEV] Invokation on __toString() for object used as array key From: florian@margaine.com (Florian Margaine) --bcaec50fe063d3e0fd0503b9600d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I do believe that the UString class would benefit from such a change. Why would it be confusing to implement this? Regards, *Florian Margaine* Le 23 sept. 2014 12:42, "Michael Wallner" a =C3=A9crit : > On 2014-09-23 11:45, Leigh wrote: > > On 23 September 2014 10:35, Michael Wallner wrote: > >> On 2014-09-23 11:15, Leigh wrote: > >>> He doesn't want to add the object as a key, he wants to invoke > __toString(). > >> > >> Did I write that? > > > > No, you didn't, sorry. > > > > I just didn't see how an object with an explicit method to convert it > > to a string compared to using a resource straight up as a key. If you > > were implying the resource would be cast to int, then I get the > > comparison. > > > > Does it really make bugs that hard to find? You'd expect the user to > > know when they're using this behaviour when they write the code... > > well, I would. > > > > I suppose explicit casting removes any ambiguity, we use > > $a[(int)$resource] all the time for arrays of sockets and that's > > served us fine over the years. Hmm, thinking about it > > $a[(string)$object] is a lot clearer than having some magic sort it > > out. You're right, I'll retreat now :) > > > > I'm a "victim" of $array[(int) $resource] myself. I just tried to > explain that the behavior is intentional and not an oversight. That > doesn't mean that is set in stone for all times. > > -- > Regards, > Mike > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --bcaec50fe063d3e0fd0503b9600d--