Map.renameKey
renameKey($oldKey, $newKey) -> self
Description
Rename a key, while keeping the same value.
$map = { a: 1, b: 22 } $map.rename('b', 'z') print($map) //= { a: 1, z: 22 }
Rename a key, while keeping the same value.
$map = { a: 1, b: 22 } $map.rename('b', 'z') print($map) //= { a: 1, z: 22 }