Hi!

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.

What you are looking for is implemented in array_slice(). Python has
shortcuts for this thing, like a[1:-1], but PHP doesn't. If you wanted
to RFC something here, I think the idea of $a[X:Y] with array_slice semantics could be doable. $a[-1:1] would be your case then.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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

Reply via email to