MabeEnum\EnumSet::diff PHP Method

diff() public method

Produce a new set with enumerators in this but not in other (this - other)
public diff ( EnumSet $other ) : EnumSet
$other EnumSet Other EnumSet(s) of the same enumeration to produce the union
return EnumSet
    public function diff(EnumSet $other)
    {
        $bitset = '';
        foreach (func_get_args() as $other) {
            if (!$other instanceof self || $this->enumeration !== $other->enumeration) {
                throw new InvalidArgumentException(sprintf("Others should be an instance of %s of the same enumeration as this %s", __CLASS__, $this->enumeration));
            }
            $bitset |= $other->bitset;
        }
        $clone = clone $this;
        $clone->bitset = $this->bitset & ~$bitset;
        return $clone;
    }