Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85288 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92769 invoked from network); 20 Mar 2015 13:29:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2015 13:29:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.179 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.179 mail-wi0-f179.google.com Received: from [209.85.212.179] ([209.85.212.179:35109] helo=mail-wi0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/11-21731-BA02C055 for ; Fri, 20 Mar 2015 08:29:17 -0500 Received: by wibdy8 with SMTP id dy8so17116542wib.0 for ; Fri, 20 Mar 2015 06:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=LSX4RjejzAAXPa92UGch785LBA14LspBmIRBySOoA5U=; b=ppto827mkIgu6Xljf2KBDRFBRKfJ/w+jcfPKeOuiVz8rDk59YVhW9o2t4KMTOEbe5x 1MoLpP4NxqkMqnuboZzME5B9ikrtJcUpgsntCQd1qsJ5/gY/e/offo656ipqsjyxvf90 UTXCtxXKKeil1OjxK3BZwQ1kjEXsBUjUUqOC1WgmOKYu9LzP3KtLokvdmPDM1GN5Keqq BTU86gnXWy2yYu1IgGS0MLUpB3C40Ow/ZCnd091p7aX9mcK+iHF7Sw99L+6rRDVIpvCq FZPPA3CKUs9W9jphPpItfQ96024hPFtEHHLinL1p5xP47IB4kd20f6GGxJ3JqpbVY2aR oxog== X-Received: by 10.180.96.136 with SMTP id ds8mr5172877wib.47.1426857685696; Fri, 20 Mar 2015 06:21:25 -0700 (PDT) Received: from [192.168.0.159] ([62.189.198.114]) by mx.google.com with ESMTPSA id vq9sm6364942wjc.6.2015.03.20.06.21.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Mar 2015 06:21:25 -0700 (PDT) Message-ID: <550C1EC3.8000106@gmail.com> Date: Fri, 20 Mar 2015 13:21:07 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Alex Bowers CC: internals@lists.php.net References: <550B5A81.1090706@gmail.com> <550B7189.4040608@gmail.com> <7486C296-7535-4633-AFE2-02E7BBC67BC5@gmail.com> <550C1176.9050307@gmail.com> <550C1AE4.8090607@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------020309000302020703040804" Subject: Re: [PHP-DEV] RFC - Array slice syntactic sugar From: rowan.collins@gmail.com (Rowan Collins) --------------020309000302020703040804 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Alex Bowers wrote on 20/03/2015 13:10: > > $array['x':'z'] = []; // Remove all elements with keys between 'x' > and 'z', inclusive > > > I believe i mentioned in the past about strings not being allowed for > ranges, since there is no real way to check this (and this appears to > be by key not by index) which should be a separate RFC thread, > assuming this one gets accepted to be expanded upon. I'm carrying over my syntax from previous examples - [a:b] meaning a key-based slice (which implies accepting string keys, because there's no reason not to) vs [@a:b] meaning a positional slice. See my earlier mail on the 6 different types of access - I do realise you're not planning to implement them all, just playing with the implications of different decisions if we carry them through consistently in the future. Regards, -- Rowan Collins [IMSoP] --------------020309000302020703040804--