function AbstractMap::remove
Parameters
K $key The key to remove from the map.:
Return value
T | null the previous value associated with key, or `null` if there was no mapping for `$key`.
Overrides MapInterface::remove
File
-
vendor/
ramsey/ collection/ src/ Map/ AbstractMap.php, line 140
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 remove(int|string $key) : mixed {
$previousValue = $this->get($key);
unset($this[$key]);
return $previousValue;
}