nikeee / bit-array
A bit array implementation for PHP
v0.2.0
2022-06-22 18:17 UTC
Requires
- php: >=7.4
Requires (Dev)
- phpunit/phpunit: ^9
- rawr/cross-data-providers: ^2.3
Suggests
- ext-gmp: *
This package is auto-updated.
Last update: 2025-03-29 01:01:04 UTC
README
A bit-array implementation for PHP. Compatible with the BitArray of ts-ds.
Depending on the extensions that are available, GMP
is used under the hood for faster bit operations.
Installation
composer require nikeee/bit-array
Usage
<?php require_once 'vendor/autoload.php'; use Nikeee\BitArray\BitArray; $arr = BitArray::create(8); $arr->set(1, true) ->set(2, true) ->set(4, true); $arr->applyBitwiseNot(); echo "Bits: " . $arr->toBitString() . "\n";