On Tue, Mar 14, 2017 at 6:25 PM, Jesse Schalken <m...@jesseschalken.com> wrote:
> I didn't realise packed arrays could still have gaps. If that's the case,
> why can't [12=>'foo', 42=>'bar'] be packed (index 0-11 and 13-41 are
> undefined)?
>
It can be, but in practice isn't likely to be since that's a lot of
empty space for a two element array.  It will end up mixed pretty
quickly before you get to that point.

> I agree checking if the array is both packed and without gaps would still
> make a worthwhile optimisation.
>
Oh yeah, btw... six hours ago...
https://github.com/php/php-src/commit/c74bc87c74f48bc55541b3bf2fc67d595f58a3b5

-Sara

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

Reply via email to