Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85339 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39924 invoked from network); 20 Mar 2015 21:41:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2015 21:41:49 -0000 Authentication-Results: pb1.pair.com header.from=bowersbros@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bowersbros@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.176 as permitted sender) X-PHP-List-Original-Sender: bowersbros@gmail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:37453] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/6D-64120-C149C055 for ; Fri, 20 Mar 2015 16:41:48 -0500 Received: by wixw10 with SMTP id w10so2968808wix.0 for ; Fri, 20 Mar 2015 14:41:46 -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=iNg2xmaRyw74RIGHm33+t5ZP8mD0aJI/q7ib2OlLxhI=; b=A3y2X98ekF2Hn/8SyZssPY+OopD8ced8hyOTVWg+uQkgQJv1hmfRvx067dYjbVZsb1 w1MX1wx29yEpXJfdjlfCYFZsn8/pIikuWQc+Am0H3phfgksDzP2ZFX7u97FeDy5pC9Nd 5I0wsdBJ4kaxMdMOXhg0DDeav1qZDtZB65OFoYIDk+aG7abxMNj3VZi/oE/FYhv+WkV/ ncWe0LD/DvIn8GfIaU9E0noLFkoP5QVg5GI+9RXcWvWoITf+EDBnqaWnP0xjD/I0CZ/h 9T7bji1SGpGCq3u6raSalxaMWkGIZsZlCnshZiyzJ+t67iOngPHj8IZaR6XkpHZYLd0V xDqg== MIME-Version: 1.0 X-Received: by 10.194.179.41 with SMTP id dd9mr167227410wjc.72.1426887706057; Fri, 20 Mar 2015 14:41:46 -0700 (PDT) Received: by 10.28.62.84 with HTTP; Fri, 20 Mar 2015 14:41:45 -0700 (PDT) In-Reply-To: <550C917D.5000904@gmail.com> References: <550B5A81.1090706@gmail.com> <550C8879.70002@gmail.com> <550C917D.5000904@gmail.com> Date: Fri, 20 Mar 2015 21:41:45 +0000 Message-ID: To: Stanislav Malyshev Cc: PHP Internals Content-Type: multipart/alternative; boundary=089e01493d5cdaa7a40511bf2ec0 Subject: Re: [PHP-DEV] RFC - Array slice syntactic sugar From: bowersbros@gmail.com (Alex Bowers) --089e01493d5cdaa7a40511bf2ec0 Content-Type: text/plain; charset=UTF-8 > > Why not use array_slice for it? There certainly are ways to do most of what this RFC covers, however most of them don't lend themselves well to clean code in my opinion. Thats why this RFC is listed as being syntactic sugar. On 20 March 2015 at 21:30, Stanislav Malyshev wrote: > Hi! > > > It would give different results, for a reason. There is currently no way > > to get an array item by positional index, whilst preserving the keys. > > I imagine having such way may be useful. However, reusing array access > syntax for that does not look like a good idea, since it would look like > existing array syntax but work completely different. Why not use > array_slice for it? > -- > Stas Malyshev > smalyshev@gmail.com > --089e01493d5cdaa7a40511bf2ec0--