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

From: Date: Fri, 07 Jul 2006 21:13:03 +0000
Subject: Re: Bitwise operators and check if an bit is NOT within the flag.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-239206@lists.php.net to get a copy of this message
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 ~self::VALIDATE_CHECK3 is doing what you want... Echo that out and see if it's the number you would expect... -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#239206) next »