Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85304 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57496 invoked from network); 20 Mar 2015 16:23:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2015 16:23:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=bowersbros@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bowersbros@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: bowersbros@gmail.com X-Host-Fingerprint: 209.85.212.179 mail-wi0-f179.google.com Received: from [209.85.212.179] ([209.85.212.179:35450] helo=mail-wi0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/AC-21731-F794C055 for ; Fri, 20 Mar 2015 11:23:28 -0500 Received: by wibdy8 with SMTP id dy8so21324840wib.0 for ; Fri, 20 Mar 2015 09:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=E5LqE4m2QG5Jkk9OOVbT2uRpKVJzIbzewh2VSj9LDd8=; b=F9WYm4+3GWVHeUrmfqtYnTqB0zYfAqscV4ubdKLWTNrCaZMfQ1bGvORdr9DvAXrRAr +aYdEjyfW81u9y9ynVWSK3UK3iIR70EHFRW2KsxUqW/Kal/8M0Q9ckq3Bw4hI53LdMyv yjsuWjFiKGdA/LPuYRM9T9QGIWBMJzVF+q9iNAByjGDZ2dJ+7EO++ataEj8kVMTZ2N8N Kq8dKSAht9Kos0osKKIqQmEJ18mIJCanJMlj1yvUikEjfIeBa7uI2ZuR4ZqRpjid3bHE wpp9U3h/gU+zDrfq0Qr32W5mm4egCEWUadJWoco7fTFKPR8cXfTBr+WtuJ30QFcUdhE1 3MGw== MIME-Version: 1.0 X-Received: by 10.180.11.180 with SMTP id r20mr6486228wib.36.1426868604245; Fri, 20 Mar 2015 09:23:24 -0700 (PDT) Received: by 10.28.62.84 with HTTP; Fri, 20 Mar 2015 09:23:24 -0700 (PDT) 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> <550C1EC3.8000106@gmail.com> <550C317E.8020508@gmail.com> Date: Fri, 20 Mar 2015 16:23:24 +0000 Message-ID: To: Leigh Cc: Rowan Collins , internals@lists.php.net Content-Type: multipart/alternative; boundary=001a11c34f304c1cd40511babcbe Subject: Re: [PHP-DEV] RFC - Array slice syntactic sugar From: bowersbros@gmail.com (Alex Bowers) --001a11c34f304c1cd40511babcbe Content-Type: text/plain; charset=UTF-8 I agree the scope is enough. Going with what Rowan added in about individual indexes (not slicing) by position to be added in with this, since the two go together. In my opinion, the $thing[-1] should be a separate RFC, since it has little to do with slicing, which is the primary focus of this RFC. On 20 March 2015 at 16:17, Leigh wrote: > > On Mar 20, 2015 4:00 PM, "Alex Bowers" wrote: > >> > >> IMHO, stick to offsets in the first instance, this is a slice notation, > first order of business is to make it behave like array_slice (+on > strings). Assoc key based slicing feels pretty wrong to me at this point. > > > > > > I have to agree, we are getting ahead of ourselves. > > > > A quick summary of what this RFC should cover: > > > > - Slicing an array or string based on the positional index. > > > > Things for future RFC consideration: > > > > - Slicing an array or string based on the key. > > - Index -1 for last item of list. > > > > Everybody agree that the only focus of this RFC should be the positional > index slicing? > > I think that's plenty for initial scope, since at this point proposals are > targeting 7.1 there's plenty of time to get assoc indexing in if there is > enough support for this in the first instance. > > If there is support for positional but not assoc, we don't want this > proposal to fail on the fact they are bundled together. > > Not sure I understand your index -1 line (sorry, on phone in pub, really > just skimming mails). If you mean negative indices for positions from the > end of the array/string then +1 for this *with* the slice syntax. > > For $thing[-1] I think this only works for strings (and I have this > implemented, should probably RFC it) > https://github.com/lt/php-src/tree/string_negative_offset > > $thing[-1:] is in scope for arrays though > --001a11c34f304c1cd40511babcbe--