function MapInterface::get
Returns the value to which the specified key is mapped, `null` if this map contains no mapping for the key, or (optionally) `$defaultValue` if this map contains no mapping for the key.
Parameters
K $key The key to return from the map.:
T | null $defaultValue The default value to use if `$key` is not found.:
Return value
T | null the value or `null` if the key could not be found.
1 method overrides MapInterface::get()
- AbstractMap::get in vendor/
ramsey/ collection/ src/ Map/ AbstractMap.php
File
-
vendor/
ramsey/ collection/ src/ Map/ MapInterface.php, line 63
Class
- MapInterface
- An object that maps keys to values.
Namespace
Ramsey\Collection\MapCode
public function get(int|string $key, mixed $defaultValue = null) : mixed;