title: Is there a practical limit to the size of bit masks?
body: <p>There's a common way to store multiple values in one variable, by using a bitmask. For example, if a user has read, write and execute privileges on an item, that can be converted to a single number by saying <code>read = 4 (2^2), write = 2 (2^1), execute = 1 (2^0)</code> and then add them together to get 7.</p>
  
  <p>I use this technique in several web applications, where I'd usually store the variable into a field and give it a type of MEDIUMINT or whatever, depending on the number of different values.</p>
  
  <p>What I'm interested in, is whether or not there is a practical limit to the number of values you can store like this? For example, if the number was over 64, you couldn't use (64 bit) integers any more. If this was the case, what would you use? How would it affect your program logic (ie: could you still use bitwise comparisons)?</p>
  
  <p><em>I know that once you start getting really large sets of values, a different method would be the optimal solution, but I'm interested in the boundaries of <strong>this</strong> method.</em></p>