-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed as not planned
Description
Description
is_numeric()
is of great help to check if a string contains a number but in some cases, it creates problems:
is_numeric('2E822890835372110'); // true
is_numeric('64091761E47298917'); // true
If I understand correctly, is_numeric
detects the E within the string and considers it as exponent, so in the first case 2 * 10^822890835372110.
In order, to avoid this I would like to suggest the following change to the function:
is_numeric(mixed $value): bool
to
is_numeric(mixed $value, int $flags): bool
$flags
being a combination of:
- NUMERIC_EXPONENT
- and maybe some other flags...