Scott Arciszewski wrote on 27/07/2015 18:35:
I understand that some of the Internals contributors are allergic to
special cases. There's some validity to wanting the language to be
predictable and consistent across the board, because that might be a
UX concern in and of itself. (What do you mean this one function has
to be wrapped in try-catch blocks when the others can be prefixed with
@ to silence errors? I'm telling PHPSadness!)

This is certainly some people's concern, but Anatol has raised a subtly different consistency-related point, which is this:

Since we have no policy for what kinds of Throwable should be emitted in what circumstance, throwing anything in this function sets a precedent which will have to be incorporated in any future plan.

Assuming nobody is fundamentally against ever adding Throwables to core functions, there are a minimum number of questions that need to be agreed before adding the first one:
- when should we inherit from Error and when from Exception?
- is it ever OK to throw a plain Error or Exception (thus forcing users into the otherwise bad practice of catching those base classes)? - if not throwing the base class, how specific should sub-classes be? (i.e. a framework for defining the hierarchy, not necessarily the hierarchy itself)

If we can get agreement on those points in time for 7.0, fine, but time is very tight, and the window for such discussions has theoretically closed...

Regards,
--
Rowan Collins
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to