Hi,

2011/6/20 Robert Eisele <rob...@xarg.org>

> 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

Reply via email to