I used the abs value of this function on a 32-bit system. When porting the code to a 64-bit system I’ve found that the value is different. The following code has the same outcome on both systems.
<?php
$crc = abs(crc32($string));
if( $crc & 0x80000000){
$crc ^= 0xffffffff;
$crc += 1;
}
/* Old solution
* $crc = abs(crc32($string))
*/
?>