Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57118 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45085 invoked from network); 27 Dec 2011 13:42:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Dec 2011 13:42:09 -0000 Authentication-Results: pb1.pair.com header.from=dsnytkine@Ultralogistics.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dsnytkine@Ultralogistics.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain Ultralogistics.com from 64.197.110.172 cause and error) X-PHP-List-Original-Sender: dsnytkine@Ultralogistics.com X-Host-Fingerprint: 64.197.110.172 thrud.alliantinternet.com Received: from [64.197.110.172] ([64.197.110.172:51657] helo=thrud.alliantinternet.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/B0-41092-03BC9FE4 for ; Tue, 27 Dec 2011 08:42:09 -0500 Received: by thrud.alliantinternet.com (Postfix, from userid 1001) id E4DEC174343; Tue, 27 Dec 2011 08:42:04 -0500 (EST) To: "'Ferenc Kovacs'" Cc: "'Laruence'" , "'Pierre Joye'" , "'Patrick ALLAERT'" , "'Nikita Popov'" , "'PHP Internals'" References: <00aa01ccc499$98aa4dc0$c9fee940$@alliantinternet.com> In-Reply-To: Date: Tue, 27 Dec 2011 08:42:00 -0500 Message-ID: <00b101ccc49d$4f1e7f10$ed5b7d30$@alliantinternet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thread-Index: AczEmvh/iY8fhiluQBG5rMoRUKK11wAAh/hw Content-Language: en-us Subject: RE: [PHP-DEV] [RFC]Call for voting about const array/string dereference From: dsnytkine@Ultralogistics.com ("Dmitri Snytkine") Odd how substring can be used as index of string.=20 Dmitri Snytkine Web Developer Ultra Logistics, Inc. Phone: (888) 220-4640 x 2097 Fax: (888) 795-6642 E-Mail: dsnytkine@ultralogistics.com Web: www.ultralogistics.com "A Top 100 Logistics I.T. Provider in 2011" -----Original Message----- From: Ferenc Kovacs [mailto:tyra3l@gmail.com]=20 Sent: Tuesday, December 27, 2011 8:24 AM To: Dmitri Snytkine Cc: Laruence; Pierre Joye; Patrick ALLAERT; Nikita Popov; PHP Internals Subject: Re: [PHP-DEV] [RFC]Call for voting about const array/string = dereference 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 = dereference. > 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