PHP 8.5.0 Alpha 1 available for testing

Voting

: min(nine, four)?
(Example: nine)

The Note You're Voting On

Ren
17 years ago
Dealing with 32 bit unsigned values overflowing 32 bit php signed values can be done by adding 0x10000000 to any unexpected negative result, rather than using sprintf.

$i = crc32('1');
printf("%u\n", $i);
if (0 > $i)
{
// Implicitly casts i as float, and corrects this sign.
$i += 0x100000000;
}
var_dump($i);

Outputs:

2212294583
float(2212294583)

<< Back to user notes page

To Top