From: Pierre Joye Date: Tue, 7 Feb 2006 00:23:55 +0000 (+0000) Subject: - #36306, crc32() function result differs on 32-bit and 64-bit platforms X-Git-Tag: php-5.1.3RC1~138 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3e11a705cbebb52049c60bf73c45d951ea01cc8;p=php - #36306, crc32() function result differs on 32-bit and 64-bit platforms --- diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c index ffac9ee144..02bc54e623 100644 --- a/ext/standard/crc32.c +++ b/ext/standard/crc32.c @@ -38,7 +38,7 @@ PHP_NAMED_FUNCTION(php_if_crc32) for (len += nr; nr--; ++p) { CRC32(crc, *p); } - RETVAL_LONG(~crc); + RETVAL_LONG(~ (long) crc); } /* }}} */ diff --git a/ext/standard/tests/strings/bug36306.phpt b/ext/standard/tests/strings/bug36306.phpt new file mode 100644 index 0000000000..a4a02dd658 --- /dev/null +++ b/ext/standard/tests/strings/bug36306.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #36306 crc32() 64bit +--FILE-- + +--EXPECT-- +-858128794