Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13603 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57243 invoked by uid 1010); 29 Oct 2004 20:06:44 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 57159 invoked from network); 29 Oct 2004 20:06:44 -0000 Received: from unknown (HELO colo.lerdorf.com) (66.198.51.121) by pb1.pair.com with SMTP; 29 Oct 2004 20:06:44 -0000 Received: from rasmus2.corp.yahoo.com (rasmus2.corp.yahoo.com [207.126.233.18]) by colo.lerdorf.com (8.13.1/8.13.1/Debian-15) with ESMTP id i9TK6fm0005997; Fri, 29 Oct 2004 13:06:41 -0700 Date: Fri, 29 Oct 2004 13:06:39 -0700 (PDT) X-X-Sender: rasmus@t42p.lerdorf.com To: sterling@apache.org cc: Ilia Alshanetsky , internals@lists.php.net In-Reply-To: <24e5f3b7041029123455d9b570@mail.gmail.com> Message-ID: References: <418294D9.4070700@prohost.org> <24e5f3b7041029123455d9b570@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Negative string offset support From: rasmus@php.net (Rasmus Lerdorf) Right, I was about to say that too. If we only did it for the {} operator it would encourage people to use that little-used operator thereby removing a source of confusion and at the same time the BC issues are minimal. -Rasmus On Fri, 29 Oct 2004, Sterling Hughes wrote: > why not add it with the {} operators then? > > -sterling > > > On Fri, 29 Oct 2004 15:07:05 -0400, Ilia Alshanetsky wrote: > > I am wondering what are people's opinions on adding support for negative > > string offsets that could be used to access data from the end of a string. > > > > Ex. $a = "123"; echo $a[-1]; // would print 3 > > > > I don't think we should do this for arrays, since -1 and similar are > > valid array keys, which means adding this support for arrays would break BC. > > > > Ilia > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >