Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13608 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44666 invoked by uid 1010); 29 Oct 2004 22:37:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 44619 invoked from network); 29 Oct 2004 22:37:02 -0000 Received: from unknown (HELO mail.zend.com) (80.74.107.235) by pb1.pair.com with SMTP; 29 Oct 2004 22:37:02 -0000 Received: (qmail 2934 invoked from network); 29 Oct 2004 22:37:01 -0000 Received: from localhost (HELO AndiNotebook.zend.com) (127.0.0.1) by localhost with SMTP; 29 Oct 2004 22:37:01 -0000 Message-ID: <5.1.0.14.2.20041029153628.03a0d040@localhost> X-Sender: andi@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 29 Oct 2004 15:36:58 -0700 To: "Paul G" , In-Reply-To: <034401c4bdf3$b5c00760$0200a8c0@rusko> References: <418294D9.4070700@prohost.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] Negative string offset support From: andi@zend.com (Andi Gutmans) We haven't yet separated the semantics of {} and []. It was always planned but never done. I'll put it on my TODO and hopefully will find some time to look into it. Andi At 04:13 PM 10/29/2004 -0400, Paul G wrote: >----- Original Message ----- >From: "Ilia Alshanetsky" >To: >Sent: Friday, October 29, 2004 3:07 PM >Subject: [PHP-DEV] Negative string offset support > > > > 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. > >this, coupled with splicing, is very useful in python. i believe it would be >very useful in php as well. agree with sterling's suggestion - it would >enable all of the functionality, rather than some. > >paul > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php