Phan\Language\Element\Flags::bitVectorHasState PHP Method

bitVectorHasState() public static method

public static bitVectorHasState ( integer $bit_vector, integer $flag ) : boolean
$bit_vector integer The bit vector we'd like to get the state for
$flag integer The flag we'd like to get the state for
return boolean True if all bits in the flag are eanbled in the bit vector, else false.
    public static function bitVectorHasState(int $bit_vector, int $flag) : bool
    {
        return ($bit_vector & $flag) == $flag;
    }

Usage Example

Beispiel #1
0
 /**
  * @return bool
  * True if this is an abstract class
  */
 public function isAbstract() : bool
 {
     return Flags::bitVectorHasState($this->getFlags(), \ast\flags\MODIFIER_ABSTRACT);
 }
All Usage Examples Of Phan\Language\Element\Flags::bitVectorHasState