Ds\Map::diff() function can create a new map by using keys that aren't in another map.
public Ds\Map Ds\Map::diff( Ds\Map $map )
Ds\Map:: diff() function can return the result of removing all keys from the current instance that are present in a given map.
<?php $map1 = new \Ds\Map(["1" => "10", "2" => 20, "3" => 30]); $map2 = new \Ds\Map(["3" => "30", "4" => 40, "5" => 50]); echo "The difference between two maps: <br>"; print_r($map1 -> diff($map2)); ?>
<?php $map1 = new \Ds\Map(["1" => "Tutorials", "2" => "Point", "3" => "India"]); $map2 = new \Ds\Map([ 2" => "Point", "3" => "Tutorials", "4" => "Tutorix"]); echo "The difference between two maps: <br>"; print_r($map1 -> diff($map2)); ?>