GMP_OR(3) 1 GMP_OR(3)
gmp_or - Bitwise OR
SYNOPSIS
GMP gmp_or (GMP $a, GMP $b)
DESCRIPTION
Calculates bitwise inclusive OR of two GMP numbers.
PARAMETERS
o $a
-Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is
possible to convert the latter to a number.
o $b
-Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is
possible to convert the latter to a number.
RETURN VALUES
A GMP number resource in PHP 5.5 and earlier, or a GMP object in PHP 5.6 and later.
EXAMPLES
Example #1
gmp_or(3) example
<?php
$or1 = gmp_or("0xfffffff2", "4");
echo gmp_strval($or1, 16) . "
";
$or2 = gmp_or("0xfffffff2", "2");
echo gmp_strval($or2, 16) . "
";
?>
The above example will output:
fffffff6
fffffff2
PHP Documentation Group GMP_OR(3)