PHP 4.0 Bug #7755 Updated: bitwise and misbehaving with & 0xffffff00
| From: | stas@php.net | Date: | Tue, 12 Dec 2000 10:56:20 +0000 |
| Subject: | PHP 4.0 Bug #7755 Updated: bitwise and misbehaving with & 0xffffff00 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-40946@lists.php.net to get a copy of this message | ||
ID: 7755
Updated by: stas
Reported By: roland@astrofoto.org
Old-Status: Analyzed
Status: Suspended
Bug Type: Math related
Assigned To:
Comments:
I suspend this bug since PHP has no good solution for it in
the foreseeable future. Please use GMP functions for this.
Previous Comments:
---------------------------------------------------------------------------
[2000-11-23 07:41:55] stas@php.net
Still not working, possibly won't for some time - since PHP
numbers are 32-bits signed, so they don't work well as
32-bit unsigned.
---------------------------------------------------------------------------
[2000-11-14 12:04:03] stas@php.net
Please try latest CVS version (also available from
snaps.php.net) and report if it works better.
---------------------------------------------------------------------------
[2000-11-10 22:29:04] roland@astrofoto.org
I have the following snippet of code
$w = ip2long("192.168.2.35");
$x = $w & 0xffffff00;
$y = $w & (0xffffff << 8);
$z = ip2long("192.168.2.0");
printf ("w = %s<br>", dechex($w));
printf ("x = %s<br>", dechex($x));
printf ("y = %s<br>", dechex($y));
printf ("z = %s<br>", dechex($z));
which outputs this:
w = c0a80223
x = 80000000
y = c0a80200
z = c0a80200
I can't come up with any reason why $x should be set as it is....
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7755