peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.33k stars 202 forks source link

array_shift() should update the next insert if appropriate #1001

Closed jakubmisek closed 2 years ago

jakubmisek commented 2 years ago

e.g. when array_shift() results in an empty array; the array's next insert ID should be 0;

$a[] = 0;
array_shift($a);
$a[] = 0;
print_r( $a ); // expected array( 0 => 0 )

expected: array( 0 => 0 ) actual: array( 1 => 0 )