Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85302 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54388 invoked from network); 20 Mar 2015 16:17:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2015 16:17:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.54 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 209.85.213.54 mail-yh0-f54.google.com Received: from [209.85.213.54] ([209.85.213.54:34366] helo=mail-yh0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/FB-21731-4184C055 for ; Fri, 20 Mar 2015 11:17:25 -0500 Received: by yhch68 with SMTP id h68so41952400yhc.1 for ; Fri, 20 Mar 2015 09:17:21 -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=b9LyT+u7D9iLq5uYJeiSjyOHBU9nuZowkf82eP5Kg/I=; b=CBPvTxn1bAbMxYxPsp65MiUWzn3xbS+y4R4H0eCDBUUYFwMxjfEtMOaLR8AmQv49P1 +6C+Lu63cIMMs0Xsc4vK8f/icGlXfK+X+12u8cevLbSn48jXriLkNYIYuTeDZESPnpVX ve388TwN6RAinUpWA8wHT+URb8jQl5ASHVuS2mQC3Xon0PEUAk1SzpFHrpJWGBd8S921 QQGkyIuuL0m+DLP7HVkM/Wy18amT5tQ0uMW5750xS9XaNLuat5UZJ+/tvGUKuR07Fi94 ScMGXLvUM/NF0v2aXmGC9WbA4UUzb62QHiCjUqgYTLcO0USxt6m1ZsZKwq1iWvdcyc8W n3yA== MIME-Version: 1.0 X-Received: by 10.52.14.99 with SMTP id o3mr85269407vdc.39.1426868241440; Fri, 20 Mar 2015 09:17:21 -0700 (PDT) Received: by 10.52.177.7 with HTTP; Fri, 20 Mar 2015 09:17:21 -0700 (PDT) Received: by 10.52.177.7 with HTTP; Fri, 20 Mar 2015 09:17:21 -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:17:21 +0000 Message-ID: To: Alex Bowers Cc: Rowan Collins , internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf30334b77ac25720511baa6ba Subject: Re: [PHP-DEV] RFC - Array slice syntactic sugar From: leight@gmail.com (Leigh) --20cf30334b77ac25720511baa6ba Content-Type: text/plain; charset=UTF-8 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 --20cf30334b77ac25720511baa6ba--