WorkerPool icon indicating copy to clipboard operation
WorkerPool copied to clipboard

array_shift should not be used on associative array because it reindexes it

Open dev97 opened this issue 1 year ago • 0 comments

% php -a
Interactive shell

php > $x = [100 => 100, 200 => 200, 300 => 300];
php > echo json_encode($x);
{"100":100,"200":200,"300":300}
php > array_shift($x);
php > echo json_encode($x);
[200,300]

dev97 avatar Aug 21 '24 10:08 dev97