Bug #17077: Negative string indexing
| From: | csaba at alum dot mit dot edu | Date: | Tue, 07 May 2002 17:01:45 +0000 |
| Subject: | Bug #17077: Negative string indexing | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-7157@lists.php.net to get a copy of this message | ||
From: csaba@alum.mit.edu
Operating system: All
PHP version: 4.2.0
PHP Bug Type: Feature/Change Request
Bug description: Negative string indexing
This is my third (and last, for now) enhancement request. Please be
patient with me - I am an ardent PHP fan.
The single biggest thing I would like to see for strings is to be able to
provide a negative index, where $str{-1} means the last character,
$str{-2} the penultimate character and so on down to $str[0] ===
$str[-strlen($str)]
It's just a convenince thing since I can already get there using substr or
slice - it would just be a more compact way of writing it.
Regards to the PHP team,
Csaba Gabor
--
Edit bug report at http://bugs.php.net/?id=17077&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17077&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17077&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17077&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17077&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17077&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17077&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17077&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17077&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17077&r=globals