Change language

PHP Ds / Map xor () function

Syntax:
DsMap public DsMap::xor (DsMap $map)
Parameter: this parameter contains another value map.Return value:used to return a map that contains the xor of the current map with a different map.Below the program illustrate the Ds / Map::xor()function in PHP:Program 1:  
// Declare a new map $a = new DsMap ([ "a" = > 1, "b" = > 3, "c" = > five]);  
// Declare another new map $b = new DsMap ([ " a " = > 2, " c " = > 3, " d " = > 6 ]);  
// Print xor of two cards echo ( "xor of both map is:" ); print_r ( $a -> xor ( $b ));  
?>
Exit:
xor of both map is: DsMap Object ([0] = > DsPair Object ([key] = > b [value] = > 3) [1] = > DsPair Object ([key] = > d [value] = > 6))
Program 2:  
// Declare a new map $a = new DsMap ([ "a" = > "Geeks" , "b" = > "for" , "c" = > "Geeks" ]);  
// Declare another new map $b = new DsMap ([ " b " = > " Computer " , "e" = > "Science" , " f " = > " Portal " ]) ;  
// Print xor of two cards echo ( "xor of both map is:" ); print_r ( $a -> xor ( $b ));  
?>
Exit:
xor of both map is: DsMap Object ([0] = > DsPair Object ([key] = > a [value] = > Geeks) [1] = > DsPair Object ([key] = > c [value] = > Geeks) [2] = > DsPair Object ([key] = > e [value] = > Science) [3] = > DsPair Object ([key] = > f [value] = > Portal))
Link: https://www .php.net / manual / en / ds-map.xor.php

Shop

Best laptop for Sims 4

$

Best laptop for Zoom

$499

Best laptop for Minecraft

$590

Best laptop for engineering student

$

Best laptop for development

$

Best laptop for Cricut Maker

$

Best laptop for hacking

$890

Best laptop for Machine Learning

$950

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method