Arnaud Le Blanc
efc8f0ebf8
Deprecate zend_atol() / add zend_ini_parse_quantity() ( #7951 )
...
Add zend_ini_parse_quantity() and deprecate zend_atol(), zend_atoi()
zend_atol() and zend_atoi() don't just do number parsing.
They also check for a 'K', 'M', or 'G' at the end of the string,
and multiply the parsed value out accordingly.
Unfortunately, they ignore any other non-numerics between the
numeric component and the last character in the string.
This means that numbers such as the following are both valid
and non-intuitive in their final output.
* "123KMG" is interpreted as "123G" -> 132070244352
* "123G " is interpreted as "123 " -> 123
* "123GB" is interpreted as "123B" -> 123
* "123 I like tacos." is also interpreted as "123." -> 123
Currently, in php-src these functions are used only for parsing ini values.
In this change we deprecate zend_atol(), zend_atoi(), and introduce a new
function with the same behavior, but with the ability to report invalid inputs
to the caller. The function's name also makes the behavior less unexpected:
zend_ini_parse_quantity().
Co-authored-by: Sara Golemon <pollita@php.net >
2022-06-17 14:12:53 +02:00
..
2021-05-06 12:16:35 +02:00
2021-12-15 20:27:40 +01:00
2022-06-17 14:12:53 +02:00
2022-03-23 23:59:41 +00:00
2021-05-06 12:16:35 +02:00
2021-06-29 11:30:26 +02:00
2021-05-06 12:16:35 +02:00
2022-06-13 08:55:54 -04:00
2022-06-17 14:12:53 +02:00
2021-08-17 12:29:04 +02:00
2022-06-13 11:09:12 +02:00
2021-10-05 09:51:58 +01:00
2021-12-16 12:32:09 +03:00
2021-12-15 20:27:40 +01:00
2022-02-24 16:14:47 +01:00
2020-09-02 15:10:41 +02:00
2022-04-01 15:48:41 +01:00
2021-07-03 21:03:47 +02:00
2020-06-17 13:04:01 +00:00
2020-04-14 15:16:26 +00:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2020-09-07 21:35:48 +03:00
2020-06-24 13:40:27 +02:00
2022-05-23 19:06:41 +01:00
2022-05-23 19:06:41 +01:00
2022-05-27 09:05:33 +01:00
2022-05-27 09:05:33 +01:00
2022-04-01 15:48:41 +01:00
2021-11-26 11:51:42 +01:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2021-08-19 10:39:23 +02:00
2022-05-13 23:30:20 +01:00
2021-08-19 10:39:23 +02:00
2020-06-24 09:55:19 +02:00
2022-05-24 19:23:48 +02:00
2021-05-06 12:16:35 +02:00
2020-05-14 13:35:12 +02:00
2022-05-23 21:57:31 +01:00
2022-05-23 21:57:31 +01:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2022-05-16 16:21:29 +02:00
2022-04-23 12:11:26 +01:00
2022-05-13 23:30:20 +01:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2022-04-01 15:48:41 +01:00
2021-09-29 12:21:49 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2022-03-13 13:48:21 +00:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2021-06-29 11:30:26 +02:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2022-05-13 23:30:20 +01:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2022-05-13 23:30:20 +01:00
2022-04-01 15:48:41 +01:00
2021-03-16 14:22:25 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-06-29 11:30:26 +02:00
2022-04-01 15:48:41 +01:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2022-05-22 16:13:44 +01:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-12 14:55:53 +01:00
2021-05-06 12:16:35 +02:00
2021-09-07 10:04:00 +02:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-05-22 16:06:27 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-07-07 00:02:57 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-04-23 12:15:13 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2021-08-11 14:51:55 +02:00
2021-06-29 11:30:26 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2021-05-12 18:58:44 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2022-04-23 12:15:13 +01:00
2022-04-23 12:15:13 +01:00
2022-04-01 15:48:41 +01:00
2021-09-01 16:58:46 +02:00
2022-04-01 15:48:41 +01:00
2021-05-06 12:16:35 +02:00
2022-04-01 15:48:41 +01:00
2022-05-16 12:03:35 +02:00
2021-05-06 12:16:35 +02:00
2021-08-20 14:50:25 +02:00
2021-11-03 15:18:26 +03:00
2021-08-20 14:50:25 +02:00
2021-05-06 12:16:35 +02:00
2021-09-01 16:59:35 +02:00
2022-04-23 11:06:21 +02:00
2021-06-29 11:30:26 +02:00