update : 2015.11.03
php.shukuma.com

검색:
 
 
Bitwise XOR

gmp_xor

(PHP 4 >= 4.0.4, PHP 5, PHP 7)

gmp_xor — Bitwise XOR

설명

GMP gmp_xor ( GMP $a , GMP $b )

Calculates bitwise exclusive OR (XOR) of two GMP numbers.

인수

a

PHP 5.5 이전에서 GMP 수 resource나, PHP 5.6 이후에서 GMP 객체, 또는 수로 변환할 수 있는 문자열일 수 있습니다.

b

PHP 5.5 이전에서 GMP 수 resource나, PHP 5.6 이후에서 GMP 객체, 또는 수로 변환할 수 있는 문자열일 수 있습니다.

반환값

PHP 5.5 이전에서는 GMP 수 resource, PHP 5.6 이후에서는 GMP 객체.

예제

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";
?>

위 예제의 출력:

1011110111000100