Closed SailorMax closed 4 months ago
That's because it's not an integer, but a float: https://3v4l.org/Ynacn When you type a number literal so large it can't fit in an integer, you get a float literal instead of an int literal.
I understand the reason, but this is bad solution with unexpected results. If we will try to write some kind of specific encoder (messagepack for example) we will get broken result.
The automatic change from integer to float happens in many cases, e.g. also when doing some arithmetic e.g. PHP_INT_MAX+1. If you want to change such a fundamental behaviour you'll have to contact the mailing list and do an RFC.
Description
The following code:
Resulted in this output:
But I expected this output instead:
PHP Version
PHP 8.3.3
Operating System
Debian 11