ID:               44317
 Updated by:       [EMAIL PROTECTED]
 Reported By:      vadim at vadiaz dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: Linux
 PHP Version:      5.2.5
-Assigned To:      
+Assigned To:      pajoye
 New Comment:

As you noticed PHP has no unsigned integer. It can't return the same
visual result without using strings. But we can't return string as it
will break the backward compatibility and will add other bad side
effects (related to bc too). See the manual notes if you like to get
ride of this limitation.


Previous Comments:
------------------------------------------------------------------------

[2008-03-03 09:42:38] vadim at vadiaz dot com

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 this bug report at http://bugs.php.net/?id=44317&edit=1

Reply via email to