Md. Al - mustanjid
Md. Al - mustanjid

Reputation: 1

Why is the "NOT" bitwise operator showing output -1 or negative in PHP?

I am checking bitwise NOT operator including OR in Php but don't get why the output is -1. Is there anyone who can explain why the output is 1 of the following code? Thanks in Advance

$x = 15;
$y = 3;

echo $x | ~$y;

Output: -1;

Upvotes: 0

Views: 48

Answers (0)

Related Questions