On the documentation for array_fill the start_index description mentions: “If start_index is negative, the first index of the returned array will be start_index and the following indices will start from zero.” This is consistent everywhere when an explicit negative key is used and implicit keys are used afterwards.

In other words, any array that has a number n as it's first numeric key will have for it's next implicit key either n+1 if n >= 0 or 0 if n < 0 . This RFC proposes to make this consistent by always using n+1 regardless of the sign of n .

As also mentioned on the relevant part of the arrays documentation:

if no key is specified, the maximum of the existing integer indices is taken, and the new key will be that maximum value plus 1 (but at least 0).

This RFC proposes to eliminate the parenthesis part of that sentence. Which is an exception to a rule, that people have to learn one way or the other.

This proposal targets 8.0. However, to ease the transition and find places where this may become an issue, there is a secondary vote for emitting a deprecation notice in cases where the behavior will change.

All the variables in this code:

<?php $a = array_fill ( - 2 , 3 , true ) ; $b = [ - 2 => true , true , true ] ; $c = [ "string" => true , - 2 => true , true , true ] ; unset ( $c [ "string" ] ) ; $d [ - 2 ] = true ; $d [ ] = true ; $d [ ] = true ;

Result in the array:

array ( 3 ) { [ - 2 ] => bool ( true ) [ 0 ] => bool ( true ) [ 1 ] => bool ( true ) }

NOTE: If accepted, during the deprecation phase the following E_DEPRECATED notice would be emitted in cases where the behavior will change: Deprecated: In the next major version of PHP the implicit keys of this array will start from -1 instead of 0 in ...

With the implementation of this RFC , they will all result in: