Larger Than Int¶
<?php
printf('%u', -1);
print PHP_EOL;
print PHP_INT_MAX;
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¶
Larger then PHP_INT_MAX [Try me]
PHP Features¶
Last updated: 14 July 2026