function AbstractMap::put
Parameters
K $key The key to put or replace in the map.:
T $value The value to store at `$key`.:
Return value
T | null the previous value associated with key, or `null` if there was no mapping for `$key`.
Overrides MapInterface::put
File
-
vendor/
ramsey/ collection/ src/ Map/ AbstractMap.php, line 108
Class
- AbstractMap
- This class provides a basic implementation of `MapInterface`, to minimize the effort required to implement this interface.
Namespace
Ramsey\Collection\MapCode
public function put(int|string $key, mixed $value) : mixed {
$previousValue = $this->get($key);
$this[$key] = $value;
return $previousValue;
}