Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85292 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8778 invoked from network); 20 Mar 2015 13:47:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2015 13:47:24 -0000 Authentication-Results: pb1.pair.com header.from=vikhudec@yahoo.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=vikhudec@yahoo.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain yahoo.com designates 98.138.91.110 as permitted sender) X-PHP-List-Original-Sender: vikhudec@yahoo.com X-Host-Fingerprint: 98.138.91.110 nm17-vm6.bullet.mail.ne1.yahoo.com Received: from [98.138.91.110] ([98.138.91.110:56216] helo=nm17-vm6.bullet.mail.ne1.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6C/B4-21731-9E42C055 for ; Fri, 20 Mar 2015 08:47:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1426859239; bh=sy+5KmE/qh0pM1lTeOjIgrgJm32aZgGuZapyp0sFPH8=; h=Date:From:To:CC:Subject:In-Reply-To:References:From:Subject; b=bhxbDFpgMA3HGS4IFnJKGpFfAZ30uFlrblymx78c1Mu3Lljghl+jLWAXjkVyd2fyZ226wSaFimRPJJiJZQyC1uXO3OuN7YnThnd49cW/O1Jczvf08OgOTPTl4guiPZIi3MhQoUHcegChdC+zGMarqNBH2NvuX9NMIasqQdK6MrQNy8oT4JsQp5Wp9QKKrT80ZuvAhGVZlEoMCXkdWbGbNCoanJGbnEilGzAKSxstEO3fUXNQkZzPkT5OooIyngWegtvXpZA4eFyVgFb9LftPrGoLHS44icjpyVp+iADDPN6//H3yL2KSFIgw/rBzB1CaeYd4Sa0On+bmQwpRrxynug== Received: from [98.138.226.179] by nm17.bullet.mail.ne1.yahoo.com with NNFMP; 20 Mar 2015 13:47:19 -0000 Received: from [46.228.39.77] by tm14.bullet.mail.ne1.yahoo.com with NNFMP; 20 Mar 2015 13:47:19 -0000 Received: from [127.0.0.1] by smtp114.mail.ir2.yahoo.com with NNFMP; 20 Mar 2015 13:47:19 -0000 X-Yahoo-Newman-Id: 341382.69906.bm@smtp114.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: RIQSjKkVM1ngixB8KBOQ1.0CosOilfkpHK3jm5tqf8yNWlT 7B_gE0fLchwrcuvOIMBFe2qTUUO5mfSpDq93djXAL2qa_1QNfMrzCnHlrMbm CSZL0LBD0D9TiDz2lTMDJuW8Vs3nqPis1tgbs.aNaPWOKjbyR1ZbMlVEKjGQ VGzvlnNAz8HSmNyAR6kEypsl5Ve4CKBs1F_9Gxv.JUZw205bK.dr7ufl3728 hgw6DlyQj8mW2IFjYOfppICTS3d8xgcyNZw21L_N0Ad..Csm3dCb_pydP.rM 4EBgtSGGgVuTUXbGjjymRitW64NwWBstEDtzcATf.kHGh_LE2NVGOSAc.fqg Rd167STluC4kpQHxsZpBDWJ6zDefQrsu2Ml5CSsPqwXhLhtETv9ZKncl3LkA HyR99qKdsy.xEWHq6XS27ce9e0t7PkHzM6LGmpjubUzmUEuj0cbQ8n2lCifo aN_tmw5Q5DZ5CGyXUCGuWp3B2L69DY7FZXUMXByPd8cLtGuHs99n6NWgCdZ5 mo_ahCPBdVLYg8yvtk5hMjLEIb_mykHGMCckv4qV1twesqQWjTCRbv6spjBN kZIDcHM.lvs0- X-Yahoo-SMTP: RwGK.6yswBDCDhnjbZq3y.OXT_Xz Date: Fri, 20 Mar 2015 13:47:18 +0000 X-Priority: 3 (Normal) Message-ID: <1599684052.20150320134718@yahoo.com> To: Rowan Collins CC: internals@lists.php.net In-Reply-To: <550C1DEC.5060706@gmail.com> 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> 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 Rowan, On Fri, 2015-03-20, at 13:17, Rowan Collins wrote: > I personally like the idea of string offsets having similar but slightly > different syntax from array offsets, to make clear which you're using. I > use {} instead of [] for that reason, but at the moment the syntaxes are > completely interchangeable as far as I can tell. I'm in exactly the same situation; I'd thought for ages that the curly-brace syntax was only valid for string offsets, so I use them in favour of square brackets to avoid confusion. I'd support reserving curly-braces for string offsets only (and vice-versa for square brackets / arrays). One awkward edge-case is where a class implements both __toString() and ArrayAccess. It would be nice if you could distinguish which type of offset you're accessing without casting. Theoretical phpt test: http://pastebin.com/9b6YLC29 Vik