Bug #17116 Updated: Bitwise & does not give expected results

From: Date: Thu, 09 May 2002 12:27:18 +0000
Subject: Bug #17116 Updated: Bitwise & does not give expected results
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-7316@lists.php.net to get a copy of this message
ID: 17116 Updated by: lindsay.marshall@ncl.ac.uk Reported By: lindsay.marshall@ncl.ac.uk Status: Open Bug Type: Math related Operating System: redahat 7.2 PHP Version: 4.2.0 New Comment: I just tried the following: $a1 = $r->status; $a2 = $current->mask; echo $a1.' '.$a2.' '.($a1&$a2); And it still prints out 8191 7 0 I feel as though I am doing something really stupid here, but cannot for the life of me see what it is. Previous Comments: ------------------------------------------------------------------------ [2002-05-09 08:17:02] lindsay.marshall@ncl.ac.uk I have a piece of code that effectively does this : $r->f = 8191; $c->m = 7; $r->f & $c->m returns 0!! The above code works fine when tested standalone, but the equivalent code in my program generates 0. I can write ; echo $r->status.' '.$current->mask.' '.($r->status&$current->mask); and the output I get is 8191 7 0 If I write : $a1=7;$a2=8191; echo $r->status.' '.$current->mask.' '.($a1&$a2); I get 8191 7 7 Something is getting confused somewhere!! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17116&edit=1

« previous php.bugs (#7316) next »