array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.gmp-xor.php', 1 => 'gmp_xor', ), 'up' => array ( 0 => 'ref.gmp.php', 1 => 'GMP Functions', ), 'prev' => array ( 0 => 'function.gmp-testbit.php', 1 => 'gmp_testbit', ), 'next' => array ( 0 => 'class.gmp.php', 1 => 'GMP', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/gmp/functions/gmp-xor.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)
gmp_xor — Bitwise XOR
Calculates bitwise exclusive OR (XOR) of two GMP numbers.
A GMP object.
Example #1 gmp_xor() example
<?php
$xor1 = gmp_init("1101101110011101", 2);
$xor2 = gmp_init("0110011001011001", 2);
$xor3 = gmp_xor($xor1, $xor2);
echo gmp_strval($xor3, 2) . "\n";
?>
The above example will output:
1011110111000100