Re: [PHP-DEV] array_values should be a no-op for packed layout arrays

2017-03-15 Thread Julien Pauli
On Wed, Mar 15, 2017 at 12:58 AM, Jesse Schalken wrote: > > On Wed, Mar 15, 2017 at 10:39 AM, Sara Golemon wrote: > >> >> Oh yeah, btw... six hours ago... >> https://github.com/php/php-src/commit/c74bc87c74f48bc55541b3 >> bf2fc67d595f58a3b5 >> >> -Sara >> > > Awesome, thanks Sara. > > Nice Sara

Re: [PHP-DEV] array_values should be a no-op for packed layout arrays

2017-03-14 Thread Jesse Schalken
On Wed, Mar 15, 2017 at 10:39 AM, Sara Golemon wrote: > > Oh yeah, btw... six hours ago... > https://github.com/php/php-src/commit/c74bc87c74f48bc55541b3bf2fc67d > 595f58a3b5 > > -Sara > Awesome, thanks Sara.

Re: [PHP-DEV] array_values should be a no-op for packed layout arrays

2017-03-14 Thread Sara Golemon
On Tue, Mar 14, 2017 at 6:25 PM, Jesse Schalken 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

Re: [PHP-DEV] array_values should be a no-op for packed layout arrays

2017-03-14 Thread Jesse Schalken
On Wed, Mar 15, 2017 at 3:48 AM, Sara Golemon wrote: > > Minor nit: [12=>'foo', 42=>'bar'] is not a packed array. > > [0=>'foo', 2=>'bar'] is however, so your primary point stands. > However it should be simple enough to detect when a packed array is > also vector-like (indexed from 0 to n-1) and

Re: [PHP-DEV] array_values should be a no-op for packed layout arrays

2017-03-14 Thread Sara Golemon
On Tue, Mar 14, 2017 at 11:21 AM, Julien Pauli wrote: >> I noticed this commit >> > 9e853282fac968d9cd454> >> recently in HHVM, which makes array_values() return the same array back if >> it's packed instead of building a copy. >> >> My

Re: [PHP-DEV] array_values should be a no-op for packed layout arrays

2017-03-14 Thread Julien Pauli
On Mon, Mar 13, 2017 at 6:34 AM, Jesse Schalken wrote: > I noticed this commit > 9e853282fac968d9cd454> > recently in HHVM, which makes array_values() return the same array back if > it's packed instead of building a copy. > > My unde