Support negative indexes for arrays and strings
| From: | Marc Easen | Date: | Fri, 14 Jan 2011 18:21:28 +0000 |
| Subject: | Support negative indexes for arrays and strings | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-51268@lists.php.net to get a copy of this message | ||
Hello everyone,
I would like to open the discussion around the support of negative indexes, as I feel a lot of
developers will benefit from this syntactical sugar.
Example:
$foo = array(1,2,3);
echo $foo[2]; // 3
echo $foo[-1]; // 3
$bar = 'baz';
echo $foo[2]; // 'z'
echo $foo[-1]; // 'z'
The change to PHP is quite trivial, but as it's a change to language it needs to be discussed.
I'm happy to open a RFC, I have got a wiki account but I haven't got permission to add a
wiki page. Whom do I need to contact regarding getting correct permissions to add/edit wiki pages?
Kind Regards
Marc