PHP 4.0 Bug #2261: Binary operators fail on args > 2G
| From: | wsl at fruit dot warande dot net | Date: | Wed, 08 Sep 1999 10:34:05 +0000 |
| Subject: | PHP 4.0 Bug #2261: Binary operators fail on args > 2G | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10696@lists.php.net to get a copy of this message | ||
From: wsl@fruit.warande.net
Operating system: Debian GNU/Linux i386 Potato
PHP version: 4.0 Beta 2
PHP Bug Type: Scripting Engine problem
Bug description: Binary operators fail on args > 2G
<?
$n = 2211674498;
$a = $n >> 24;
$b = ($n >> 16) & 255;
$c = ($n >> 8) & 255;
$d = $n & 255;
echo "<p>$a.$b.$c.$d</p>\n";
?>
It should output 131.211.121.130 (my IP-number) but outputs -128.0.0.0 instead. If I set $n to
211674498, it works fine.
Config options and compiler (options) used:
# ./configure --with-apxs=/usr/bin/apxs --with-mysql --with-zlib --disable-static --disable-debug
--prefix=/usr --sysconfdir=/etc
# gcc -O6 -mpentium -fomit-frame-pointer -pipe -w -v
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.1/specs
gcc version 2.95.1 19990816 (release)