Hello all,
When I print out -1 in binary I get 11111111111111111111111111111111, as you can see in the following code.
$x = 0;
echo decbin($x); //prints 0
echo decbin(~$x); /prints 11111111111111111111111111111111
I am totally confused. Why are all bits set? As far as I expected only the first bit should have been set, and perhaps also the last one (to indicate the sign).
I guess I'm missing on a major piece of the puzzle.
Thanks to all of you out there.