Oihana PHP

unsetFlag.php

Table of Contents

Functions

unsetFlag()  : int
Unsets (removes) a specific flag from a bitmask.

Functions

unsetFlag()

Unsets (removes) a specific flag from a bitmask.

unsetFlag(int $mask, int $flag) : int
Parameters
$mask : int

The original bitmask.

$flag : int

The flag to remove.

Tags
example
use function oihana\core\bits\unsetFlag;

const FLAG_A = 1 << 0; // 1
const FLAG_B = 1 << 1; // 2

$mask = FLAG_A | FLAG_B; // 3
$mask = unsetFlag($mask, FLAG_B);
// $mask is now 1 (FLAG_A only)
author

Marc Alcaraz (ekameleon)

since
1.0.7
Return values
int

The new bitmask with the flag removed.


        
On this page

Search results