Bitmask

A bitmask is a single integer, or sequence of bits, used to set, clear, or check the state of specific bits in another integer, usually via bitwise operations.

<?php

    $bitfield = 0b111; // 7
    $bitmask  = 0b100; // 4

    $result  = $bitfield | $bitmask; // 0b011 == 3

?>

Documentation

See also How to use bitmasks in PHP.

Related : Bitfield, Bitwise Operators

Related packages : gksh/bitmask