hasFlag.php
Table of Contents
Functions
- hasFlag() : bool
- Checks whether a specific flag is set in a bitmask.
Functions
hasFlag()
Checks whether a specific flag is set in a bitmask.
hasFlag(int $mask, int $flag) : bool
This function is useful when working with bitwise flags.
You can combine multiple flags using the bitwise OR operator (|)
and then check if a particular flag is present in the combined mask.
Parameters
- $mask : int
-
The bitmask value, potentially containing multiple flags combined with
|. - $flag : int
-
The specific flag to check for in the mask.
Tags
Return values
bool —Returns true if the given flag is present in the mask, false otherwise.