> 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: > > echo $foo[2]; // 3 > echo $foo[-1]; // 3
Negative indexes are used already - for negative indexes. What should: $foo = array(1,2,3, -1 => 4, 5, 6); echo $foo[-1]; return? Now it returns 4. > > $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? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php