Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57117 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43031 invoked from network); 27 Dec 2011 13:24:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Dec 2011 13:24:29 -0000 Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qy0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:38688] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/50-41092-B07C9FE4 for ; Tue, 27 Dec 2011 08:24:27 -0500 Received: by qcsd16 with SMTP id d16so7326147qcs.29 for ; Tue, 27 Dec 2011 05:24:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CW/gBMTxH9e9RYNnnjl7rFUuI5IyAIe13h2361sBLFA=; b=h6gNKFovucodqOfQyc4A7BYn+OdTtWwfVT6aAKbSRllgausM3nLDG1SDqYMNpVn0WS YIq1EYtCcrcy5d1CJqn2saS2PI6ZcMUCWgiZKKxyTyniTBs+zQy4COyD0Ke8wanoCtCn 9GTweZpkY7WNmuEFHkQqLn11nrAf+EmX+IWJo= MIME-Version: 1.0 Received: by 10.229.76.78 with SMTP id b14mr10138625qck.138.1324992264461; Tue, 27 Dec 2011 05:24:24 -0800 (PST) Received: by 10.229.54.140 with HTTP; Tue, 27 Dec 2011 05:24:24 -0800 (PST) In-Reply-To: <00aa01ccc499$98aa4dc0$c9fee940$@alliantinternet.com> References: <00aa01ccc499$98aa4dc0$c9fee940$@alliantinternet.com> Date: Tue, 27 Dec 2011 14:24:24 +0100 Message-ID: To: Dmitri Snytkine Cc: Laruence , Pierre Joye , Patrick ALLAERT , Nikita Popov , PHP Internals Content-Type: multipart/alternative; boundary=00235429e0b840dfe204b512cd33 Subject: Re: [PHP-DEV] [RFC]Call for voting about const array/string dereference From: tyra3l@gmail.com (Ferenc Kovacs) --00235429e0b840dfe204b512cd33 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Dec 27, 2011 at 2:15 PM, Dmitri Snytkine < dsnytkine@ultralogistics.com> wrote: > No sure who can and cannot vote, I don't see any way for me to vote. > https://wiki.php.net/rfc/voting currently the following two groups can vote: - people having php.net svn account - people having a wiki account and manually granted with the voters group membership > > My opinion that it=E2=80=99s a good idea to have array and string derefer= ence. > One feature however, looks odd, like it does not belong here: > echo "foobar"["foo"][0] // output f > > Does it look odd to anyone else? I mean, this sort of thing can be added > but it just looks like a separate feature alltogether. > which part seems odd to you? this rfc and the proposed patch doesn't introduce any new behavior, just allows using "foobar" everywhere where you could use $foobar =3D "foobar" I guess you found it odd that $foobar =3D "foobar"; echo $foobar["foo"]; prints 'f', but that's not a new feature, this is how php works currently. we had a discussion about that recently, and AFAIK in the latest 5.4, a warning will be triggered if you try to reference a string offset using a string index. the scalar referencing proposed here should (and AFAIK it does) behave exactly the same as it would work if a variable with the same value would be used. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --00235429e0b840dfe204b512cd33--