#51073 [Opn->Bgs]: crc32() function result differs on 64-bit Linux platforms and others

From: Date: Wed, 17 Feb 2010 18:21:04 +0000
Subject: #51073 [Opn->Bgs]: crc32() function result differs on 64-bit Linux platforms and others
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147796@lists.php.net to get a copy of this message
ID: 51073 Updated by: pajoye@php.net Reported By: jian at theorchard dot com -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: Linux RHEL 5 PHP Version: 5.3.1 New Comment: It is the signed output of an unsigned value. The values are correct (there was other bug reports about this, check them to get a more verbose explanation). Previous Comments: ------------------------------------------------------------------------ [2010-02-17 17:47:22] jian at theorchard dot com Description: ------------ According to bug# 36306, this issue should have been fixed. But I found it not entirely fixed across all platforms. crc32 is returning an unsigned integer on a 64-bit Linux platform. It does return the signed integer from a 64-bit Windows platform as well as 32-bit Windows/Linux platforms. I found PHP_INT_SIZE and PHP_INT_MAX constants have different values on that 64-bit Linux server with values 8 and 9223372036854775807 respectively. They are 4 and 2147483647 on other 32-bit platforms and 64-bit Windows platform. Reproduce code: --------------- <? echo crc32("884385799717_1_1") . "\n"; ?> Expected result: ---------------- I expect to see value -676770709 both on 32-bit and 64-bit platforms. Actual result: -------------- On 64-bit Linux platform I see 3618196587 On 64-bit Windows platform I see -676770709 On 32-bit platforms I see -676770709 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=51073&edit=1

« previous php.bugs (#147796) next »