Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62798 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70335 invoked from network); 4 Sep 2012 14:47:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Sep 2012 14:47:19 -0000 Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.42 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.160.42 mail-pb0-f42.google.com Received: from [209.85.160.42] ([209.85.160.42:35436] helo=mail-pb0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/34-46870-67416405 for ; Tue, 04 Sep 2012 10:47:19 -0400 Received: by pbbrp8 with SMTP id rp8so9442393pbb.29 for ; Tue, 04 Sep 2012 07:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=C0xJkrpYiH2a/hi/x4FGiKnh7qc5C8LjTMQqf2yaysY=; b=O269+cH5u4YCgggD/87GsVTWBg/3H0RIpKBjlXFkRzChYaNnURLYZHEyhke2ka8wdw m2WWohMYeF4QrDN7NPgsBmOqnVCmpE0av0epMfjgqbZe6kpZUQJ6tEEv6LTPC1SRTMwD 6PAq+4GQjO1jci9HxU1f8ii4OR26qXXw6E/9LR2Rp/EjnbMeI0y55Xw8WQMW/GuNcjyY AzqqZ/pQchoapZ0wYvRoKSoTqfjbaIDr4i9F1o/nMqASBHH45DJSeaj9xIaIFu6dkLwd 0A8O88h68cpNI5HlmSOyxBinP1GIfaKNExQD2BcMmtZoVW6kBHBIozckq0aUuJGws4bE 6EBA== MIME-Version: 1.0 Received: by 10.68.203.34 with SMTP id kn2mr45991568pbc.144.1346770034745; Tue, 04 Sep 2012 07:47:14 -0700 (PDT) Sender: tjerk.meesters@gmail.com Received: by 10.66.147.201 with HTTP; Tue, 4 Sep 2012 07:47:14 -0700 (PDT) In-Reply-To: References: <13095916.1346546580825.JavaMail.root@wamui-haziran.atl.sa.earthlink.net> <96E453F9E8B844E090D9D375033A9E53@apfelbox.net> Date: Tue, 4 Sep 2012 22:47:14 +0800 X-Google-Sender-Auth: AgQtAK6-yA1eEoKD9IFavyt6Svw Message-ID: To: =?ISO-8859-1?Q?David_Z=FClke?= Cc: Jannik Zschiesche , "slevy1@pipeline.com" , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b10c85183e29a04c8e15529 Subject: Re: [PHP-DEV] Re: Support negative indexes for arrays and strings From: datibbaw@php.net (Tjerk Anne Meesters) --047d7b10c85183e29a04c8e15529 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Sep 4, 2012 at 6:31 PM, David Z=FClke wrote: > On 03.09.2012, at 09:37, Jannik Zschiesche wrote: > > > The main problem arises from the ambiguity for $array[-1] for arrays. > > But this is easily solvable: just introduce a slice operator. > > > > $array[:-1] and the ambiguity is gone. > > That would return an array containing the last item as the sole member, > not the last item itself. > Assuming Python syntax, that returns the array of items up to (not including) the last item actually, an array containing the last item would be $array[-1:] - I wouldn't mind slice syntax :) nifty stuff ... maybe too nifty. > > David > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 -- Tjerk --047d7b10c85183e29a04c8e15529--