On Tue, Sep 4, 2012 at 6:31 PM, David Zülke <david.zue...@bitextender.com>wrote:
> On 03.09.2012, at 09:37, Jannik Zschiesche <he...@apfelbox.net> wrote: > > > The main problem arises from the ambiguity for $array[-1] for arrays. > > But this is easily solvable: just introduce a slice operator. > > > > $array[:-1] and the ambiguity is gone. > > That would return an array containing the last item as the sole member, > not the last item itself. > Assuming Python syntax, that returns the array of items up to (not including) the last item actually, an array containing the last item would be $array[-1:] - I wouldn't mind slice syntax :) nifty stuff ... maybe too nifty. > > David > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- -- Tjerk