PHP 8.1 adds support for string keys


<?php
$apples = [ 'red' => '🍎',  'green' => '🍏' ];
$others = [ 'green' => '🍐', 'pink' => '🍑' ];
$fruits = [ ...$apples, ...$others ];

var_dump( $fruits );
?>
Result:


array(3) {
  'red' => string(4) "🍎"
  'green' => string(4) "🍐"
  'pink' => string(4) "🍑"
}