ID: 31569 Updated by: [EMAIL PROTECTED] Reported By: php at milonic dot com -Status: Open +Status: Feedback Bug Type: Math related Operating System: Fedora/Linux 9 PHP Version: 4.3.10 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-01-16 12:59:15] php at milonic dot com Description: ------------ Values returned using the following code produce different results (incorrect) in PHP-4.3.10 and PHP-4.3.9 on Fedora Core 3. When the same code is executed on a Linux 9 or FreeBSD5.3 machine the values are correct. Could be a Fedora problem but thought you'd like to take a look. Reproduce code: --------------- <? function fillZeros($a, $b){ $z = hexdec(80000000); if ($z & $a){ $a = ($a>>1); $a &= (~$z); $a |= 0x40000000; $a = ($a>>($b-1)); } else{ $a = ($a>>$b); } return $a; } function mixture($a,$b,$c) { $a -= $b; $a -= $c; $a ^= (fillZeros($c,13)); $b -= $c; $b -= $a; $b ^= ($a<<8); $c -= $a; $c -= $b; $c ^= (fillZeros($b,13)); $a -= $b; $a -= $c; $a ^= (fillZeros($c,12)); $b -= $c; $b -= $a; $b ^= ($a<<16); $c -= $a; $c -= $b; $c ^= (fillZeros($b,5)); $a -= $b; $a -= $c; $a ^= (fillZeros($c,3)); $b -= $c; $b -= $a; $b ^= ($a<<10); $c -= $a; $c -= $b; $c ^= (fillZeros($b,15)); return array($a,$b,$c); } $test= mixture("11", "22", "33"); echo "$test[0], $test[1], $test[2]\n"; ?> Expected result: ---------------- Should be: 251066875, -1654377486, -1500734959 Actual result: -------------- But instead get: 251066875, 1541925888, -402039036 Only happens on Fedora, all other boxes are fine. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31569&edit=1