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

51 Views Asked by At

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;
0

There are 0 best solutions below