Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53395 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48866 invoked from network); 20 Jun 2011 12:13:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2011 12:13:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=felipensp@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=felipensp@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: felipensp@gmail.com X-Host-Fingerprint: 74.125.83.170 mail-pv0-f170.google.com Received: from [74.125.83.170] ([74.125.83.170:56821] helo=mail-pv0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 82/FC-34681-4793FFD4 for ; Mon, 20 Jun 2011 08:13:40 -0400 Received: by pvh10 with SMTP id 10so3751068pvh.29 for ; Mon, 20 Jun 2011 05:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=sZ0KX82cAjrgHLxbzbr3+EfxfeYNxtnpwWmcg90YicA=; b=lApLMIfZET4hOZhtdF6i2tHKHmPwU4AB6vVksvLSPrYJ63HQhKBmDVlnjUMx2Hv5+1 ABRSpNo76Qy1IneStvt5nC+eglgGkx/KbA/v+sn4Wy12ylhW+zoRpFn03fQcW2vzIVo8 ItnR5HEBOWr1zt1EYTUMpCMob1G/1hXg5fli8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=ETcOLYKuOANiV8jm2c6id2d0/Tw1ug4WOxfhVVNhRHdDq8veXV38Ad0q//MXaIMn6o Yy+zKp3cTrcHvjJIQFS5VMntzEsVpIJ6x4T8xxKzLJCgKwBr3ixok4kYEKOAlVnQNtys pHIaTt/U2qUriuW23jtr+62BMUcko9sH14lZM= Received: by 10.142.171.18 with SMTP id t18mr970564wfe.57.1308572017052; Mon, 20 Jun 2011 05:13:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.50.19 with HTTP; Mon, 20 Jun 2011 05:13:16 -0700 (PDT) In-Reply-To: References: Date: Mon, 20 Jun 2011 09:13:16 -0300 Message-ID: To: Robert Eisele Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=000e0cd2de323d4ba304a623aad6 Subject: Re: [PHP-DEV] Negative string offsets From: felipensp@gmail.com (Felipe Pena) --000e0cd2de323d4ba304a623aad6 Content-Type: text/plain; charset=UTF-8 Hi, 2011/6/20 Robert Eisele > 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"; > > $str[0] == "H" > $str[-1] == "o"; > > If -6 is used as offset, the old warning is displayed because it's the > first > undefined negative offset. > > The same thing for setting: > > $str[-1] = '0'; > $str[-4] = "4"; > > will result in "H4ll0" > > Would be glad to see this in 5.4 > > Robert > I like this one, +1. -- Regards, Felipe Pena --000e0cd2de323d4ba304a623aad6--