Re: Negative string offsets
| From: | Robert Eisele | Date: | Mon, 20 Jun 2011 17:24:01 +0000 |
| Subject: | Re: Negative string offsets | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53437@lists.php.net to get a copy of this message | ||
2011/6/20 Stas Malyshev <smalyshev@sugarcrm.com>
> 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
>