Returns true if and only if the designated bit is set.
Computes ((this & (1<<n)) != 0).
int $n The bit to test, 0-based.:
\InvalidArgumentException If the bit to test is negative.
public function testBit(int $n) : bool { if ($n < 0) { throw new \InvalidArgumentException('The bit to test cannot be negative.'); } return $this->shiftedRight($n) ->isOdd(); }