Bug #17116: Bitwise & does not give expected results
| From: | lindsay dot marshall at ncl dot ac dot uk | Date: | Thu, 09 May 2002 12:17:02 +0000 |
| Subject: | Bug #17116: Bitwise & does not give expected results | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-7315@lists.php.net to get a copy of this message | ||
From: lindsay.marshall@ncl.ac.uk
Operating system: redahat 7.2
PHP version: 4.2.0
PHP Bug Type: Math related
Bug description: Bitwise & does not give expected results
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 bug report at http://bugs.php.net/?id=17116&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17116&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17116&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17116&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17116&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17116&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17116&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17116&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17116&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17116&r=globals