src/Util/Arrays.php
public static function renameKey(array &$arr, $oldKey, $newKey): void
    {
        $offset = self::searchKey($arr, $oldKey);
        if ($offset !== null) {
            $keys = \array_keys($arr);
            $keys[$offset] = $newKey;
            $arr = \array_combine($keys, $arr);
        }
    }
public static function renameKey(array &$arr, $oldKey, $newKey): void
    {
        $offset = self::searchKey($arr, $oldKey);
        if ($offset !== null) {
            $keys = \array_keys($arr);
            $keys[$offset] = $newKey;
            $arr = \array_combine($keys, $arr);
        }
    }
public static function renameKey ( array & $ arr , $ oldKey , $ newKey ) : void { $ offset = self :: searchKey ( $ arr , $ oldKey ) ; if ( $ offset !== null ) { $ keys = \ array_keys ( $ arr ) ; $ keys [ $ offset ] = $ newKey ; $ arr = \ array_combine ( $ keys , $ arr ) ; } }
Renames key in array.

@param array      $arr
@param int|string $oldKey
@param int|string $newKey
Renames key in array .