From: vadim at vadiaz dot com Operating system: Linux PHP version: 5.2.5 PHP Bug Type: Feature/Change Request Bug description: crc32() function breaks compatibility on 32-bit and 64-bit platforms
Description: ------------ crc32() function result differs on 32-bit and 64-bit platforms which break compatibility. there is very ugly workaround like using dechex(crc32()) but this means that all the code must be reviewed before migrating to any platform which is not 32bit. Even there is no unsigned integer in PHP, this function must return the same numeric result. And sure this buggy behavior must be well documented. Reproduce code: --------------- php -r ' echo crc32("platform independant") . "\n";' Expected result: ---------------- -858128794 Actual result: -------------- 3436838502 -- Edit bug report at http://bugs.php.net/?id=44317&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44317&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44317&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44317&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44317&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44317&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44317&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44317&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44317&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44317&r=support Expected behavior: http://bugs.php.net/fix.php?id=44317&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44317&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44317&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44317&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44317&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44317&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44317&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44317&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44317&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44317&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44317&r=mysqlcfg