Re: [RFC] Throwable Interface
| From: | Aaron Piotrowski | Date: | Sun, 24 May 2015 20:11:38 +0000 |
| Subject: | Re: [RFC] Throwable Interface | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86366@lists.php.net to get a copy of this message | ||
> On May 24, 2015, at 2:08 PM, Marc Bennewitz <dev@mabe.berlin> wrote:
>
> Where are the new classes and the interface located if it's not in the global namespace or
> do I muss something?
Sorry if what I wrote wasn’t clear. Throwable, Error, TypeError, and ParseError will be built-in
interfaces/classes in the root namespaces. So users will not be able to make classes with those
exact names, but classes with those names in a non-global namespace (e.g.,
\Vendor\Package\TypeError) will still be possible. I’ve updated the RFC to make this clearer.
> If I remember right the TypeException/TypeError will be thrown in some cases of internal
> functions with strict argument count.
> In my opinion a missing argument or to much arguments has nothing to do with the type and
> should have it's own Exception/Error class.
I believe this actually generates a warning, it does not throw an exception. However, this does
remind me of another point: It is possible that more classes extending Error could be created in the
future for different error reasons. Anything that throws an Error could later be changed to throw an
object extending Error without a BC break. This is a separate issue though and could be discussed in
a future RFC.
Aaron Piotrowski