Skip to content

Instantly share code, notes, and snippets.

@jbarciauskas
Created May 16, 2012 04:59
Show Gist options
  • Save jbarciauskas/2707568 to your computer and use it in GitHub Desktop.
Save jbarciauskas/2707568 to your computer and use it in GitHub Desktop.
BitArray demo
require_once("BitArray.php");
$test = new BitArray(128);
$test->setBit(12);
$test2 = new BitArray(128);
$test2->setBit(126);
$test3 = BitArray::orFn($test, $test2);
var_dump($test3);
var_dump($test);
var_dump($test2);
$test2 = new BitArray(60);
$test2->setBit(20);
$test3 = BitArray::orFn($test3, $test2);
var_dump($test3->toIntArray());
var_dump($test3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment