Description
The following code:
number_format(1.23456, 9876543210);
Resulted in this output:
Fatal error: Allowed memory size of 1342177280 bytes exhausted (tried to allocate 2147483680 bytes)
But I expected this output instead:
Anything but a out of memory error.
This is obviously not a high priority issue, as the $decimal parameter is invalid, but thought I would report it.
It produces the output of "1" in PHP versions 8.0.30 and 7.4.33. I would consider this an acceptable value. Or maybe 1.23456, or an error message, thrown exception, but not memory exhaustion.
This is easily solved by validation the $decimal parameter, so not high priority.
PHP Version
8.4.0, 8.3.14, 8.2.26, 8.1.31
Operating System
Windows