Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85350 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76497 invoked from network); 20 Mar 2015 23:28:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2015 23:28:13 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.177 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.177 mail-pd0-f177.google.com Received: from [209.85.192.177] ([209.85.192.177:36491] helo=mail-pd0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/15-64120-C0DAC055 for ; Fri, 20 Mar 2015 18:28:13 -0500 Received: by pdbcz9 with SMTP id cz9so121921187pdb.3 for ; Fri, 20 Mar 2015 16:28:10 -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:content-transfer-encoding; bh=xZSiyL2dhZKVbJBg5cpKP67eQCBnMRmKmXjFRdIt4Z4=; b=YfgbgRur7vHGRnGNaIz9mbjRcpkuSB1/CkaZvGT5TgJz0nSD30FtanzhEyUnewIaEs 7GxAr1p8+s17KkjJQyTVhsfrBabVBueIRdJXyJMadYbhZBMXcDWl/4n5HAj+b2B2JwtM 0TCWar+YHsCb/VuXTgSdnHGSJ6t7EhszGDknDG7JWoUgSqwc9AsFQA5iT7FIwyLrrsNo WwTlXSnK9bV1pmrUqlBvM2U+51I65qXBgFQH82ZH2YFkw3i2cVPRjCP3n478NJxlazeN 078lBL2x83wpnLT/9oM+UZo9XaZQ5YORnQ2ojNk6ujJILXjTV5K9NiFjtzTEPu7MW4LS xFPA== X-Received: by 10.68.248.39 with SMTP id yj7mr641479pbc.58.1426894090265; Fri, 20 Mar 2015 16:28:10 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id ms7sm9838497pdb.8.2015.03.20.16.28.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Mar 2015 16:28:09 -0700 (PDT) Message-ID: <550CAD08.4080400@gmail.com> Date: Fri, 20 Mar 2015 16:28:08 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Alex Bowers CC: Christoph Becker , PHP Internals References: <550B5A81.1090706@gmail.com> <550C8879.70002@gmail.com> <550C90EF.7080404@gmx.de> <550C9B39.5080801@gmail.com> <550CA73A.2010308@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC - Array slice syntactic sugar From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Implementation is not something I have looked into for this yet, so I am > unsure how this would be possible; but by passing $array[*1:4], you'd be > passing an extracted array which is a reference to the original array. > Such that changing the sub array can change the parent array. Exactly. This means you can not make $array[*1:4] a real lvalue, which means you instead need to make it some kind of a hack on case-by-case basis, at which point it's no better than array_splice only implemented in more complicated way. -- Stas Malyshev smalyshev@gmail.com