Re: [PHP] Bitwise operators and check if an bit is NOT within the flag.

2006-07-07 Thread Richard Lynch
On Tue, July 4, 2006 7:35 am, Mathijs wrote: //Do if VALIDATE_CHECK1 is set BUT NOT when VALIDATE_CHECK3 is set. if ($flag2 self::VALIDATE_CHECK1 $flag2 ~self::VALIDATE_CHECK3) Did you check operator precedence for versus ? Perhaps you just need parentheses... I'm also not at all sure the

[PHP] Bitwise operators and check if an bit is NOT within the flag.

2006-07-04 Thread Mathijs
Hello there. I am working with some bitwise Operators for validating some variables. Now i need to know if an certain bit is NOT set and an other bit IS set. Example. ?php const VALIDATE_CHECK1 = 1; const VALIDATE_CHECK2 = 2; const VALIDATE_CHECK3 = 4; const VALIDATE_ALL= 7; //--Example

Re: [PHP] Bitwise operators and check if an bit is NOT within the flag.

2006-07-04 Thread Jochem Maas
Mathijs wrote: Hello there. I am working with some bitwise Operators for validating some variables. Now i need to know if an certain bit is NOT set and an other bit IS set. Example. ?php const VALIDATE_CHECK1 = 1; const VALIDATE_CHECK2 = 2; const VALIDATE_CHECK3 = 4; const