Re: [RFC] Throw ValueError for invalid characters in number base functions
| From: | Sjoerd Langkemper | Date: | Thu, 24 Sep 2026 08:22:04 +0000 |
| Subject: | Re: [RFC] Throw ValueError for invalid characters in number base functions | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-132616@lists.php.net to get a copy of this message | ||
On Thu, Sep 24, 2026, at 10:07, Lazare Inepologlou wrote:
> On Thu, 24 Sept 2026 at 09:50, Sjoerd Langkemper <sjoerd-php@linuxonly.nl> wrote:__
>> Thanks. I changed the RFC to propose throwing an Exception instead of a ValueError:
>> https://wiki.php.net/rfc/throw_error_for_invalid_characters_for_number_base
> throwing an Exception is in the correct direction. However, would it be possible to have some
> more specific exception type?
\UnexpectedValueException looks like a
> good candidate.
I agree, and I think everyone agrees that throwing a more specific exception would be better
eventually. However, the foundation for that is currently lacking. Throwing an Exception makes it
possible to make this more specific later.
Regards,
Sjoerd