ID: 31569 Updated by: [EMAIL PROTECTED] Reported By: php at milonic dot com -Status: Open +Status: Bogus Bug Type: Math related Operating System: Fedora/Linux 9 PHP Version: 4CVS-2005-01-16 New Comment:
Not PHP bug but FC3 gcc bug. Previous Comments: ------------------------------------------------------------------------ [2005-01-18 13:09:45] [EMAIL PROTECTED] $a=-3111919630; echo $b ^= ($a<<10); 1. -3111919630 cannot be represented in a 32-bit long, so it's stored in a double 2. "$a << 10" is executed using (long) integer arithmetic, so $a is converted to a long here 3. the Zend macro which converts double to long used to be miscompiled by GCC, but this was fixed in the FC3 gcc. ------------------------------------------------------------------------ [2005-01-16 17:05:12] php at milonic dot com New test case at: http://www.milonic.com/bugreports/php_fc3.php Can also confirm that JavaScript will return the same values that older Redhat returns. This is getting weirder by the minute. Cheers Andy ------------------------------------------------------------------------ [2005-01-16 15:38:38] php at milonic dot com UPDATE: Just to confirm that it's also the same with RPM-4.3.9 - so no matter if it's compiled from source or package. Also (was a long shot) changing precision in php.ini makes no difference either Cheers Andy ------------------------------------------------------------------------ [2005-01-16 15:19:48] php at milonic dot com Yes from source: gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) one that I know works fine is: gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) Basically, all machines other than 'Fedora Core 3' are working fine. It's something in FC3 that is wrong, I just can't pinpoint it. It's a standard server install by the way, nothing special. Hardware also seems to be unrelated to the problem, tried it on 2 different FC3 servers and get the same result. Cheers Andy ------------------------------------------------------------------------ [2005-01-16 14:55:06] [EMAIL PROTECTED] Did you compile from source? If so, what are the different GCC versions on all machines? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/31569 -- Edit this bug report at http://bugs.php.net/?id=31569&edit=1