Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85307 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64258 invoked from network); 20 Mar 2015 17:02:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2015 17:02:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=vikhudec@yahoo.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=vikhudec@yahoo.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain yahoo.com designates 212.82.96.55 as permitted sender) X-PHP-List-Original-Sender: vikhudec@yahoo.com X-Host-Fingerprint: 212.82.96.55 nm30.bullet.mail.ir2.yahoo.com Received: from [212.82.96.55] ([212.82.96.55:58426] helo=nm30.bullet.mail.ir2.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/00-64120-6B25C055 for ; Fri, 20 Mar 2015 12:02:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1426870962; bh=IF0eUVFeZAmD44S2C5i+dSKTFUTx13VSHuffX/rzZC4=; h=Date:From:To:CC:Subject:In-Reply-To:References:From:Subject; b=jjYPat6dhB6/baRIytntcPbVs9sXR0vaYZS6ogEui7YOYfXh7znPWFQPVJp+9sfjnwjtJMB5MP1izMxtTKIzNA4WVDV0YdSP/q4zTzbgp9fAAZ1oTD/rE32JwH/NLmT0mpl71xbi0Z3kqgvhf8ynbF+z6GcbvVqFXKOhd6uoJrHfUSkxj5oiem9RrNh3G60vKtzV8lXWeEAt+FM7TM/Kn1FVbA/f3ac3Q23pVXdIIt2LCXpndIv6mFs8/JKDxZ/8jjFOI0WLGGeAW6iUSnb5ei1ssqp9F7i14hgXdf/F/yB9JCjeN7XmzB3RQmbnlZSvA+1tRO/8xPHdwx2711Ledw== Received: from [212.82.98.127] by nm30.bullet.mail.ir2.yahoo.com with NNFMP; 20 Mar 2015 17:02:42 -0000 Received: from [46.228.39.77] by tm20.bullet.mail.ir2.yahoo.com with NNFMP; 20 Mar 2015 17:02:42 -0000 Received: from [127.0.0.1] by smtp114.mail.ir2.yahoo.com with NNFMP; 20 Mar 2015 17:02:42 -0000 X-Yahoo-Newman-Id: 836324.88613.bm@smtp114.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: uTHAInkVM1n1ru5lKxOueeT3T9kNSvwsch2oD.VBehtoGL9 ci.aCFK6DIo14M5o8JDIQiggptFUTGSlX2dM_zTAMkY3x1Fs28jCmFxVYCKS stgfWdwlBpS9brCc0UB8NtqrGZWmfhm1H3HsSYmpZFQ969sXOOnPQpclbjG4 WL8e3ssdOc5FRFh1dtFcq4C7O.iqtPSBoWKFqharOF73uItJ9i3rW6DBXkya jUrEh2Oc1.b8TjzHA2YByxVyyGZAZ3jOsz_gFPJxhoPdGf8vmSq9qMNlFB9n C3D7P.BxQsU1p19GMiYc59zJzqX_sfqNVDYrg_8n3bABL3TvSy2.xA9YAa30 Z9U_y5pCx2qRaS3OP.kcGv_qibrIMdsh.z0RSMJFxR9v8n9zHVxKQd8UGV21 tA_w12.KIUhiqGhrL1ajgXxwWI0lvrovbfUa1fnz7wPPCdKUb22EX81C5vGj hb9E.tKG.iMEN_d.Hyw972Gwo8KA0BFOQj8LAY5w17q7ZC7UDYdI7Zb.xbg- - X-Yahoo-SMTP: RwGK.6yswBDCDhnjbZq3y.OXT_Xz Date: Fri, 20 Mar 2015 17:02:42 +0000 X-Priority: 3 (Normal) Message-ID: <114590901.20150320170242@yahoo.com> To: Alex Bowers CC: internals@lists.php.net In-Reply-To: References: <550B5A81.1090706@gmail.com> <550B7189.4040608@gmail.com> <7486C296-7535-4633-AFE2-02E7BBC67BC5@gmail.com> <550C1176.9050307@gmail.com> <550C1AE4.8090607@gmail.com> <550C1DEC.5060706@gmail.com> <15030741.20150320143622@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC - Array slice syntactic sugar From: vikhudec@yahoo.com (Vik Hudec) Hi Alex, On Fri, 2015-03-20, at 14:52, Alex Bowers wrote: > But I don't think we should only match {} for strings and [] for arrays, > that seems broken to me. > Maybe you misunderstand me, I am against using two syntaxes for different > things. Based on your reply; yes, I'm definitely misunderstanding! In summary, we already have two different operations: (1) Accessing an array's element using subscript notation, eg: $foo = array('bar'); var_dump($foo[0]); // string(3) "bar" (2) Accessing a string's character using subscript notation, eg: $foo = 'bar'; var_dump($foo[0]); // string(1) "b" And we already have two different syntaxes: $var[$offset] and $var{$offset}. So we have two syntaxes that each perform two operations. Are we in agreement that this isn't a good thing? Sorry that this is all a little off-topic, but I'm interested in people's opinions because I'm considering a future RFC. My proposition would be to restrict the two subscript syntaxes to one operation each. And if your slice sugar RFC aims to augment the functionality of either one or both of these syntaxes, then that's relevant to me. Vik