(PECL ds >= 1.0.0)
Ds\Map::filter — Creates a new map using a callable to determine which pairs to include
public Ds\Map::filter ([ callable $callback ] ) : Ds\Map
Creates a new map using a callable to determine which pairs to include.
callback
callback ( mixed $key , mixed $value ) : bool
Optional callable which returns true
if the pair should be included, false
otherwise.
If a callback is not provided, only values which are true
(see converting to boolean) will be included.
A new map containing all the pairs for which either the callback
returned true
, or all values that convert to true
if a callback
was not provided.
© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/ds-map.filter.php