Beispiel #1
0
 public function testLongInt()
 {
     $bits = new BitSet('111111111111111111111111111111111111111111111111111111111111111');
     $this->assertEquals('9223372036854775807', $bits->toLongInt());
 }
Beispiel #2
0
 /**
  * Returns a new BitSet after XORing this set with another
  * @param self $other
  * @return \static
  */
 public function logicalXor(self $other)
 {
     $l = \max(array($this->count(), $other->count()));
     $new = new static();
     for ($i = 0; $i < $l; ++$i) {
         if (isset($this[$i], $other[$i])) {
             $new[$i] = (bool) ($this[$i] ^ $other[$i]);
         } else {
             $new[$i] = false;
         }
     }
     return $new;
 }