src/Flag.php
public static function mask($value, $mask)
    {
        if (!Int::is($value) || !Int::is($mask)) {
            throw new \InvalidArgumentException("Both parameters must be integers.");
        }

        return ($value & $mask);
    }
public static function mask($value, $mask)
    {
        if (!Int::is($value) || !Int::is($mask)) {
            throw new \InvalidArgumentException("Both parameters must be integers.");
        }

        return ($value & $mask);
    }
public static function mask ( $ value , $ mask ) { if ( ! Int :: is ( $ value ) || ! Int :: is ( $ mask ) ) { throw new \ InvalidArgumentException ( "Both parameters must be integers." ) ; } return ( $ value & $ mask ) ; }
Applies the mask to the given value and returns the masked result.

@param int $value The value to apply the mask to.
@param int $mask  The mask to apply.

@return int The masked value result.
@throws \InvalidArgumentException
Applies the mask to the given value and returns the masked result .