Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13611 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51437 invoked by uid 1010); 29 Oct 2004 23:05:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 51409 invoked from network); 29 Oct 2004 23:05:25 -0000 Received: from unknown (HELO jdi.jdimedia.nl) (212.204.192.51) by pb1.pair.com with SMTP; 29 Oct 2004 23:05:25 -0000 Received: from localhost (localhost [127.0.0.1]) by jdi.jdimedia.nl (8.12.11/8.12.11) with ESMTP id i9TN5OPR014552 for ; Sat, 30 Oct 2004 01:05:24 +0200 Received: from localhost (localhost [127.0.0.1]) by jdi.jdimedia.nl (8.12.11/8.12.11) with ESMTP id i9TN55hu014481; Sat, 30 Oct 2004 01:05:06 +0200 Date: Sat, 30 Oct 2004 01:05:06 +0200 (CEST) X-X-Sender: derick@localhost To: Greg Beaver cc: internals@lists.php.net In-Reply-To: <20041029193421.9557.qmail@pb1.pair.com> Message-ID: References: <418294D9.4070700@prohost.org> <20041029193421.9557.qmail@pb1.pair.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at jdimedia.nl Subject: Re: [PHP-DEV] Re: Negative string offset support From: derick@php.net (Derick Rethans) On Fri, 29 Oct 2004, Greg Beaver wrote: > 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. > > I need this, +1 How can you *need* this, you can use substr() just fine. Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org