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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux