On 2 September 2026 12:49:35 BST, Sjoerd Langkemper <[email protected]> 
wrote:
>Would it be InvalidCharForNumberBaseException extends Exception, or should it 
>be more hierarchical (InvalidCharForNumberBaseException extends ValueException 
>extends RuntimeException extends Exception)?
>
>RangeException from SPL seems useful, but we can't use that because it is in 
>another extension, right?

Both ValueException and RuntimeException are in SPL, which is always enabled, 
so there's no *practical* problem using them.

However, the policy Tim linked to lays out the details of how exceptions should 
be defined, and says the base should be \Exception, then something 
extension-specific, *not* any of the SPL exceptions.

This is a slightly complex case, because there's no extension or obvious group 
of functions to name the base under. Possibly a BaseConversionException? 

Regards,

Rowan Tommins
[IMSoP]

Reply via email to