protected static function maskHasFlag($mask, $flag)
    {
        $flag   = (int)$flag;
        return ((int)$mask & $flag) === $flag;
    }
protected static function maskHasFlag($mask, $flag)
    {
        $flag   = (int)$flag;
        return ((int)$mask & $flag) === $flag;
    }
protected static function maskHasFlag ( $ mask , $ flag ) { $ flag = ( int ) $ flag ; return ( ( int ) $ mask & $ flag ) === $ flag ; }
Checks if a bitmask has a specific flag set

@param   integer     $mask   The bitmask
@param   integer     $flag   The flag to check
@return  boolean
Checks if a bitmask has a specific flag set