On Sun, May 17, 2015 at 11:44 AM, Rowan Collins <rowan.coll...@gmail.com> wrote: > On 17 May 2015 16:02:40 BST, Levi Morrison <le...@php.net> wrote: >>In this specific case we have broken all code out there. > > Yes, in the very specific case of people who both caught all exceptions and > handled all E_RECOVERABLE errors, the existence of Throwable introduces a > slightly worse BC break than without it. > > For code that catches all exceptions but doesn't handle any errors (which > seems perfectly reasonable to me), it improves BC, as they will catch only > the same exceptions they already did. > > It's also worth looking at the feature in its own right: if we didn't have > any BC concerns, would it seem useful to be able to catch either all userland > exceptions or all system exceptions, or both? If you were defining from > scratch you could have UserException and EngineException extending Exception, > but we can't change existing uses of Exception, so Exception and Error > implementing Throwable gives us the same split.
I'm not sure I would have separated them this way. I wouldn't group TypeException in the same subtree as ParseException, for instance. One happens at compile time and the other at run time, which means the intent in what you catch is probably quite different. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php