Re: [PHP-DEV] Re: On arrays starting with a negative index

2017-03-07 Thread Pedro Magalhães
Hi Rowan, On Sat, Mar 4, 2017 at 5:09 PM, Rowan Collins wrote: > > I haven't built with the patch to check, but have you checked it behaves > correctly with other combinations? For instance [-10 => true, -5 => true, > true] or ['string_key' => true, -10 => true, true] The first example behaves

Re: [PHP-DEV] Re: On arrays starting with a negative index

2017-03-04 Thread Rowan Collins
Hi Pedro, On 02/03/2017 23:10, Pedro Magalhães wrote: Would other behaviour also be affected? For instance: $foo = [ -2 => true ]; $foo[] = true; $foo[] = true; var_dump($foo); If so, this is a much wider BC break; if not, why not? It would indeed. Internally, n

Re: [PHP-DEV] Re: On arrays starting with a negative index

2017-03-02 Thread Pedro Magalhães
Hi Rowan, On Thu, Mar 2, 2017 at 11:39 PM, Rowan Collins wrote: > > Would other behaviour also be affected? > > For instance: > > $foo = [ -2 => true ]; > $foo[] = true; > $foo[] = true; > var_dump($foo); > > If so, this is a much wider BC break; if not, why not? > It would indeed. Internally,

Re: [PHP-DEV] Re: On arrays starting with a negative index

2017-03-02 Thread Rowan Collins
On 01/03/2017 20:46, Pedro Magalhães wrote: As a clarification, the current implementation of the PR affects arrays in general, not only array_fill. Any array that starts with a negative index would continue from that index instead of 0. Meaning that [-2 => true, true, true] would now return [-2

[PHP-DEV] Re: On arrays starting with a negative index

2017-03-01 Thread Pedro Magalhães
On Wed, Feb 15, 2017 at 7:28 PM, Pedro Magalhães wrote: > Hi internals, > > I've prepared a PR (https://github.com/php/php-src/pull/2383) that would > change the current behavior of arrays when the first index is a negative > integer. > > The main goal is to make the result of array_fill more in