PHP Classes

Classes of Timm Simpkins

Recommend this page to a friend!
  All class groups  >  All authors  >  Classes of Timm Simpkins (1)  >  Mission progress status  >  Reputation  
Picture of Timm Simpkins
Name: Timm Simpkins <contact>
Classes: 1
Country: United States United States
Age: 51
All time rank: 2436334 in United States United States
Week rank: 195 Up19 in United States United States Up
All time users: 951
Week users: 0
 

 

  A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z  
  Files folder image Bitmask Magic  
Generate bitmasks for storing options.
This class is designed to create bitmasks, which are very commonly used to store lists of true or false values as a single integer.

The class can manpulate bitmasks that are not limited to 32 bits. It does not need the PHP gmp extension to provide arbitrary bit length support.

This absence of limits may encourage the storage of more complex data than merely true or false lists for those that are creative enough to figure it out.

Although PHP programmers commonly rely on databases to do much of the grunt work that is most commonly done by bitmasks in other types of programming, there is nothing better for tracking things such as user permissions, product options, and I have even used them to trace complex data structures.

Features:

- Convert arrays of booleans to bitmasks

- Convert bitmasks to booleans

- Convert bitmasks to arrays of booleans

- Store virtually unlimited bit depth bitmasks in string form

- Query individual bits to see if they are set

- Enter an associative array, manipulate bits and return the array in either the full array or only the values that are set


  A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z