Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13654 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38544 invoked by uid 1010); 1 Nov 2004 02:04:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 38408 invoked from network); 1 Nov 2004 02:04:45 -0000 Received: from unknown (HELO jan.prima.de) (83.97.50.139) by pb1.pair.com with SMTP; 1 Nov 2004 02:04:45 -0000 Received: from BAUMBART (p508EAFB5.dip.t-dialin.net [::ffff:80.142.175.181]) (IDENT: HydraIRC, AUTH: LOGIN tobi) by jan.prima.de with esmtp; Mon, 01 Nov 2004 02:03:23 +0000 Date: Mon, 1 Nov 2004 03:04:45 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1152524831.20041101030445@marcus-boerger.de> To: Wez Furlong CC: internals@lists.php.net In-Reply-To: <4e89b426041031172932ada70f@mail.gmail.com> References: <418294D9.4070700@prohost.org> <20041029193421.9557.qmail@pb1.pair.com> <5.1.0.14.2.20041029162045.0439b9c0@localhost> <20041031093753.74166.qmail@pb1.pair.com> <42285846.20041031233522@marcus-boerger.de> <41856AEF.4060501@php.net> <4e89b426041031172932ada70f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Negative string offset support From: helly@php.net (Marcus Boerger) Hello Wez, well it would. However 5.1 aims to be a major speed improvement and that's what the idea is about. best regards marcus Monday, November 1, 2004, 2:29:46 AM, you wrote: > Doesn't substr($a, -1) work ? > --Wez. > On Sun, 31 Oct 2004 17:45:03 -0500, Greg Beaver wrote: >> It would reduce the errors I inevitably get >> whenever using a complex feature like substr(). The three choices: >> >> 1) substr($a, strlen($a) - 1); >> 2) $a{strlen($a) - 1} >> 3) $a{-1} >> >> It's pretty obvious that the 3rd choice lowers the potential for all >> kinds of bugs (mistypign, wrong parameter name, incorrect parameter >> placement), and is much more readable. For those who already know how >> {} works in PHP, it's also obvious what it does at the first look >> without any speculation. -- Best regards, Marcus mailto:helly@php.net