In the documentation for PHP 7, I noticed that two predefined exceptions, Error
and ErrorException
are almost exactly the same, with ErrorException
having the additional $severity
property and Error
only being introduced in PHP 7 while ErrorException
has existed since PHP 5.1.
From what I understand, Error
is the exception which I should use to catch all internal PHP errors, such as type errors, but I don't get what is the purpose of the ErrorException
exception. What is the use of each of them, and should I base my custom exceptions off of either of them, or should I stick with the usual Exception
?