As of PHP 8.0 the example code
<?php
$b = array_fill(-2, 4, 'pear');
print_r($b);
?>
now returns
Array
(
[-2] => pear
[-1] => pear
[0] => pear
[1] => pear
)
See https://wiki.php.net/rfc/negative_array_index and https://github.com/php/php-src/pull/3772