<?php
/** * $RCSfile: example.not.BitArray.php,v $ * @author $Author: Cornelius Bolten $ * @version $Revision: 1.2 $ * @package BitArray * * @copyright * The Initial Developer of the Original Code is Cornelius Bolten. * Portions created by Cornelius Bolten are Copyright (C) 2004 by Cornelius Bolten. * All Rights Reserved. * Usage is free for non-commercial work. see http://www.phpclasses.org/browse/package/1540.html * for more information. * * @see * Latest releases are available at http://www.phpclasses.org/browse/package/1540.html * For feedback, bug reports or enhancements please contact the author at * c.bolten@grafiknews.de. Thanks a lot! * * @description * This is a working example for not-comparison of two BitArrays * **/ header("Content-Type: text/plain;"); include_once("lib.BitArray.php"); function PrintValues($myList, $myWidth) { for($i=0;$i<=($myWidth-1); $i++) { if($myList[$i]) echo "true"; else echo "false"; echo "\t"; } echo "\n"; } $myBA1 = new BitArray(4); $myBA1->set(0,false); $myBA1->set(1,false); $myBA1->set(2,true); $myBA1->set(3,true);
echo "\nBA1 values:\n"; PrintValues($myBA1->getAll(),4); echo "\nBA1 values after _not():\n"; $myBA1->_not($myBA1); PrintValues($myBA1->getAll(),4);
?>
|