> On July 30, 2014 at 6:01 AM Tjerk Meesters <tjerk.meest...@gmail.com> wrote:
> 
> 
> Instead of doing that, why not simply disallow negative array indices to be
> used as integers?
> 
> In other words, negative indices are treated as if you had used strings so
> that it doesn't upset the the last numeric index kept in the array
> structure.
> 
> From what I can tell, it should be a pretty simply patch.
> 
> Thoughts?

That would make sense, but doesn't solve all edge cases as your maximum array
index is still more than 2 times the largest positive integer on 32-bit.

Perhaps we should completely change behaviour and forbid negative indices and
store indexes that are too large as strings? That would be the sanest way to go
IMO, solves all the edge cases, and makes ["999999999999999999999999999"] and
[999999999999999999999999999] consistent, resolving that long-existing
discrepancy.
--
Andrea Faulds

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

Reply via email to