Larger Than Int

../_images/larger_than_int.png

printf() displays an integer as a string. The %u format treats the integer as an unsigned integer, while PHP only process signed integer. Here, -1 is actually 0xffffffffffffff, and the resulting string is actually twice as large as the largest PHP integer PHP_INT_MAX.

Since it is returned as a string, it looks like it is larger, but PHP converts its to float as soon as it needs to process it.

See Also

PHP Features