|
Ds\Map::intersectCreates a new map by intersecting keys with another map. Description
public Ds\Map Ds\Map::intersect
( Ds\Map
$map
)
Creates a new map containing the pairs of the current instance whose keys
are also present in the given
Parameters
Return Values
The key intersection of the current instance and another ExamplesExample #1 Ds\Map::intersect example
<?phpThe above example will output something similar to:
object(Ds\Map)#3 (2) {
[0]=>
object(Ds\Pair)#4 (2) {
["key"]=>
string(1) "b"
["value"]=>
int(2)
}
[1]=>
object(Ds\Pair)#5 (2) {
["key"]=>
string(1) "c"
["value"]=>
int(3)
}
}
|