This is about the situation where a character is not within the
specified number base. E.g. only 0-9, a-f are allowed for hexadecimal,
so what should `hexdec('z')` do?
In the past, such characters were silently ignored. Since PHP 7.4 a
deprecation notice would be generated. This commit changes that to a
ValueError.
Earlier RFC:
https://wiki.php.net/rfc/base_convert_improvements
In bindec, octdec, hexdec, and base_convert, the string to convert is the first argument, so we can throw a ValueError specific to that argument when it contains invalid characters.
Sjord marked this pull request as draft
August 11, 2026 10:51