Map.php
\Ulrichsg\Collections\Map
Package: 


A simple key-value map. Its main advantage over plain arrays is that you never have to call isset() to avoid
warnings. Supports square-bracket syntax and foreach loops.
- Implements
- Children
- \Ulrichsg\Collections\NumberMap
- License
- MIT
- Link
- https://github.com/ulrichsg/php-collections
- Version
Methods


__construct(array $data = array()) : void
Creates a new map with the given array as its contents. Omitting the argument creates an empty map.


get(mixed $key, mixed $default = null) : mixed
If the map contains the given key, returns the associated value. Otherwise, returns the default value.


remove(mixed $key) : void
Removes the given key and its associated value from the map. Does nothing if the key is not in the map.