We haven't yet separated the semantics of {} and []. It was always planned but never done.
I'll put it on my TODO and hopefully will find some time to look into it.


Andi

At 04:13 PM 10/29/2004 -0400, Paul G wrote:

----- Original Message -----
From: "Ilia Alshanetsky" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 29, 2004 3:07 PM
Subject: [PHP-DEV] Negative string offset support


> I am wondering what are people's opinions on adding support for negative > string offsets that could be used to access data from the end of a string. > > Ex. $a = "123"; echo $a[-1]; // would print 3 > > I don't think we should do this for arrays, since -1 and similar are > valid array keys, which means adding this support for arrays would break BC.

this, coupled with splicing, is very useful in python. i believe it would be
very useful in php as well. agree with sterling's suggestion - it would
enable all of the functionality, rather than some.

paul

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to