Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53437 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50980 invoked from network); 20 Jun 2011 17:24:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2011 17:24:06 -0000 Authentication-Results: pb1.pair.com header.from=robert@xarg.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=robert@xarg.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain xarg.org from 209.85.212.42 cause and error) X-PHP-List-Original-Sender: robert@xarg.org X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:49067] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AF/90-34681-3328FFD4 for ; Mon, 20 Jun 2011 13:24:05 -0400 Received: by vwl1 with SMTP id 1so1356101vwl.29 for ; Mon, 20 Jun 2011 10:24:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.118.146 with SMTP id v18mr1862349vcq.239.1308590641203; Mon, 20 Jun 2011 10:24:01 -0700 (PDT) Received: by 10.220.100.146 with HTTP; Mon, 20 Jun 2011 10:24:01 -0700 (PDT) X-Originating-IP: [92.225.216.141] In-Reply-To: <4DFF779B.1020702@sugarcrm.com> References: <4DFF779B.1020702@sugarcrm.com> Date: Mon, 20 Jun 2011 19:24:01 +0200 Message-ID: To: Stas Malyshev Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=00221572697e534b5604a62800fd Subject: Re: [PHP-DEV] Negative string offsets From: robert@xarg.org (Robert Eisele) --00221572697e534b5604a62800fd Content-Type: text/plain; charset=ISO-8859-1 2011/6/20 Stas Malyshev > Hi! > > Negative string offsets is a wish and also an implementation of my running >> PHP version for long. It operates in the same fashion like substr() with >> negative offsets, but avoids the function call and is much smarter if one >> single character has to be extracted: >> >> $str = "Hallo"; >> > > Sounds OK, but what would happen if I do $str[-10] = '?'; ? As I wrote: >> If -6 is used as offset, the old warning is displayed because it's the first >> undefined negative offset. > > > Would be glad to see this in 5.4 >> > > For that you'll need RFC with attached patch ready quite soon. > I'll attach a patch in 2 days (still have to wait for the new power cable of my macbook) > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > --00221572697e534b5604a62800fd--