• PHP Video Tutorials

PHP - Ds Map xor() Function



Ds\Map::xor() function can create a new map using the keys of either current instance or of another map, but not of both.

Syntax

public Ds\Map Ds\Map::xor( Ds\Map $map )

Ds\Map::xor() function can return a new map containing keys in the current instance as well as another map, but not of both.

Example

<?php  
   $map1 = new \Ds\Map(["x" => 1, "y" => 3, "z" => 5]);  
   $map2 = new \Ds\Map(["x" => 2, "z" => 3, "w" => 6]);  
  
   echo("The xor of both map: \n");  
   print_r($map1->xor($map2)); 
?>	
php_function_reference.htm
Advertisements