src/Flag.php
public static function isOn($value, $flag)
    {
        if (!Int::is($value)) {
            throw new \InvalidArgumentException("The \$value parameter must be of type int.");
        }

        if (!static::is($flag)) {
            throw new \InvalidArgumentException("The \$flag parameter must be of type int and a power of 2.");
        }

        return static::is($value & $flag);
    }
public static function isOn($value, $flag)
    {
        if (!Int::is($value)) {
            throw new \InvalidArgumentException("The \$value parameter must be of type int.");
        }

        if (!static::is($flag)) {
            throw new \InvalidArgumentException("The \$flag parameter must be of type int and a power of 2.");
        }

        return static::is($value & $flag);
    }
public static function isOn ( $ value , $ flag ) { if ( ! Int :: is ( $ value ) ) { throw new \ InvalidArgumentException ( "The \$value parameter must be of type int." ) ; } if ( ! static :: is ( $ flag ) ) { throw new \ InvalidArgumentException ( "The \$flag parameter must be of type int and a power of 2." ) ; } return static :: is ( $ value & $ flag ) ; }
Checks if a flag is set in a given value.

@param int $value The value to test the flag on.
@param int $flag  The flag to be tested.

@return bool Returns true if the flag is set in the value, false otherwise.
@throws \InvalidArgumentException
Checks if a flag is set in a given value .