What is gmp_or in PHP?

gmp_or is a function in PHP that returns the bitwise OR two numbers.

Syntax

gmp_or(GMP|int|string $num1, GMP|int|string $num2): GMP

Parameters

The function takes in two parameters, num1 and num2.

num1 and num2 can be a numeric string, GMPGNU Multiple Precision Arithmetic Library object, or the int type.

Return value

The function returns the bitwise OR num1 and num2. The value returned is type GMP number.

Code

<?php
$val1 = "10";
$val2 = "9";
echo gmp_or($num1, $num2);
?>

Expected output

11