RE: [PHP] & and ==

From: Date: Wed, 01 Nov 2000 10:49:21 +0000
Subject: RE: [PHP] & and ==
Groups: php.general 
Request: Send a blank email to php-general+get-23138@lists.php.net to get a copy of this message
why '&' and not '&&' ? and since you're so lazy :-)) make it be 'and' if ($flags & $F_ACTIVE != 0) { // this is OK, FALSE } # never heard of ... if (($flags and $F_ACTIVE) == 0) { // this is OK too, TRUE } #will work OK if ($flags && $F_ACTIVE == 0) { // and this fails (FALSE) } #will work even better Cheers! Lentyay! :-)) -----Original Message----- From: Victor Ivanov [mailto:v0rbiz@icon.bg] Sent: Wednesday, November 01, 2000 7:14 PM To: php-general@lists.php.net Subject: [PHP] & and == Hi all, I'm not subscribed to the list, and maybe this is old news. I have a simple flags variable and the check below makes me think that & has lower priority than ==: $flags = 0; $F_ACTIVE = 1; if ($flags & $F_ACTIVE != 0) { // this is OK, FALSE } if (($flags & $F_ACTIVE) == 0) { // this is OK too, TRUE } if ($flags & $F_ACTIVE == 0) { // and this fails (FALSE) } Is it me or there is a problem and if there is, is there quick solution? I'm using (the latest?) php-4.0.3pl1 as a module. And one more question: Is there support for the 64 bit long long int type? sscanf returned error when I tried to scan %qi... Back to adding () to ~60 checks.. ;) -- Players win and Winners play Have a lucky day

« previous php.general (#23138) next »