Skip to content

Instantly share code, notes, and snippets.

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