Ard Biesheuvel wrote:
Hans Lellelid wrote:
Personally as PHP developer (as opposed to internals developer) I am not in favor of having an interface, because I want to know that
try { // ... } catch (Exception $e) { // ... }
will catch *all* exceptions thrown by any libraries I choose to use, etc. Mixing the interface means requiring PHP developers to catch() on
Actually, you would use 'catch (IException $e)' which would catch the IException-derived Exception and all other classes that implement it.
Right ... what I'm saying is that I don't think people are expecting to have to catch(IException ...). I guess it'd be ok to simply change the docs to instruct people to always use IException, but I do think it's more intuitive that catch(Exception) catches everything. Moreover, I agree that intentionally creating exceptions that leak shouldn't be done. If it's thrown it's meant to be caught -- IMHO.
Hans
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php