(PECL ds >= 1.0.0)
Ds\Map::intersect — Creates a new map by intersecting keys with another map
public Ds\Map::intersect ( Ds\Map $map ) : Ds\Map
Creates a new map containing the pairs of the current instance whose keys are also present in the given map
. In other words, returns a copy of the current instance with all keys removed that are not also in the other map
.
A ∩ B = {x : x ∈ A ∧ x ∈ B}
Note:
Values from the current instance will be kept.
map
The other map, containing the keys to intersect with.
The key intersection of the current instance and another map
.
© 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.intersect.php