PHPackages                             phoenixrvd/bitmask - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. phoenixrvd/bitmask

ActiveUtility[Utility &amp; Helpers](/categories/utility)

phoenixrvd/bitmask
==================

bitmask utility package

1.0.2(7y ago)019MITPHPPHP &gt;=7.0

Since Jun 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/phoenixrvd/bitmask)[ Packagist](https://packagist.org/packages/phoenixrvd/bitmask)[ RSS](/packages/phoenixrvd-bitmask/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (3)Used By (0)

Bitmask
=======

[](#bitmask)

[![Minimum PHP Version](https://camo.githubusercontent.com/ec416cc33bdbb0f8f995d80346e13dbdd19cfa9265c13c61c3572b94cab6478c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e302d3838393242462e737667)](https://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/060179049e570be514ed60c809868a5dc38cf3047629a62ce23e89afd21e7a19/68747470733a2f2f706f7365722e707567782e6f72672f70686f656e69787276642f6269746d61736b2f762f737461626c652e737667)](https://packagist.org/packages/phoenixrvd/bitmask)[![composer.lock](https://camo.githubusercontent.com/8c5757a2db7b26e8d617ab3cfa3d6e7b91ee5f11fb20ea32f58720b963fe474a/68747470733a2f2f706f7365722e707567782e6f72672f70686f656e69787276642f6269746d61736b2f636f6d706f7365726c6f636b)](https://packagist.org/packages/phoenixrvd/bitmask)[![License](https://camo.githubusercontent.com/81e3f6ebe6f09aa3cdd88c32f5bd8911ad8b6f15a50b927845d42846d89d1c9f/68747470733a2f2f706f7365722e707567782e6f72672f70686f656e69787276642f6269746d61736b2f6c6963656e7365)](https://packagist.org/packages/phoenixrvd/bitmask)

[![Build Status](https://camo.githubusercontent.com/881bbfd70ca564f937b19663f78a17107b8f662a90fb354f41f813064fb9a679/68747470733a2f2f7472617669732d63692e6f72672f70686f656e69787276642f6269746d61736b2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/phoenixrvd/bitmask)[![Code Climate](https://camo.githubusercontent.com/8a5c4190609c7b9e4d98567dac39e33dab8e3d7c1efc17145bc7a1c275a536a4/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f70686f656e69787276642f6269746d61736b2e706e67)](https://codeclimate.com/github/phoenixrvd/bitmask)[![StyleCI](https://camo.githubusercontent.com/f6bf4d52fe256d2b8ee5d3d0ccc1368b8153dbb12b983e57723fc619b5bc58c7/68747470733a2f2f7374796c6563692e696f2f7265706f732f3133383232363731332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/138226713)[![Test Coverage](https://camo.githubusercontent.com/36ce33ec251d8003d1504171be64a5407df9be98afd5c09aacfdd6568e13d55b/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f70686f656e69787276642f6269746d61736b2f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/phoenixrvd/bitmask/coverage)[![BCH compliance](https://camo.githubusercontent.com/9f9e43c7a75975e03911e1f23b73fae87381625a76a5b62bc8b696096905d9b7/68747470733a2f2f626574746572636f64656875622e636f6d2f656467652f62616467652f70686f656e69787276642f6269746d61736b)](https://bettercodehub.com/results/phoenixrvd/bitmask)[![Latest Unstable Version](https://camo.githubusercontent.com/fdeb89c8f50bed6fb036402ad5718463a74a0def8098735460b985f2eb065713/68747470733a2f2f706f7365722e707567782e6f72672f70686f656e69787276642f6269746d61736b2f762f756e737461626c652e737667)](https://packagist.org/packages/phoenixrvd/bitmask)

- [Installation](#installation)
- [Example](#example)
- [Testing](#testing)
- [Copyright and license](#copyright-and-license)

In PHP a number is (mostly) 4 Bytes long. This means that one number actually uses 32 bits of the internal storage.

In this case 32 boolean values can be stored as single integer. The problem ist a 'magic numbers'.

Installation
------------

[](#installation)

Install the latest version with

```
composer require phoenixrvd/bitmask
```

Example
-------

[](#example)

Without this API [before.php](examples/before.php)

```
