function MapInterface::replace
Replaces the entry for the specified key only if it is currently mapped to some value.
Parameters
K $key The key to replace.:
T $value The value to set at `$key`.:
Return value
T | null the previous value associated with key, or `null` if there was no mapping for `$key`.
1 method overrides MapInterface::replace()
- AbstractMap::replace in vendor/
ramsey/ collection/ src/ Map/ AbstractMap.php
File
-
vendor/
ramsey/ collection/ src/ Map/ MapInterface.php, line 127
Class
- MapInterface
- An object that maps keys to values.
Namespace
Ramsey\Collection\MapCode
public function replace(int|string $key, mixed $value) : mixed;