The variable:
$mask = A | B | C;
And I can use switch to test each constant like this:
switch(true){
case $mask & A:
...
case $mask & B:
...
case $mask & C:
...
}
I was wondering if it's possible to have a nicer switch, like:
switch($mask){
case A:
...
case B:
...
case C:
...
}
I believe I need to modify the variable somehow with the weird ~ operator thing. but how?