Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_default_classes.c zend_default_classes.h zend_execute.h zend_execute_API.c
| From: | Andi Gutmans | Date: | Fri, 13 Feb 2004 17:47:43 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_default_classes.c zend_default_classes.h zend_execute.h zend_execute_API.c | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-7813@lists.php.net to get a copy of this message | ||
At 08:51 AM 2/13/2004 -0500, George Schlossnagle wrote:
On Feb 13, 2004, at 8:39 AM, Andi Gutmans wrote:Because, in any case, we would then add a construct to catch all exceptions but you'd loose out on the fact that you don't have an interface you can rely on. At the end of the day, if you look at the two alternatives, I think this is the best one and leads to much better and robust code. Andi -- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpAt 08:12 AM 2/13/2004 -0500, Sterling Hughes wrote:The above description sounds more like a 'best practice' and less like something that PHP should be forcing on users. If I explicitly choose to create an exception that must be caught specifically, I don't see why I shouldn't be allowed to do that.What is the reasoning for this new change?The reasoning is that it allows users to do a catch-all (which otherwise we'd add to the language syntax). It also adds cleanliness to the Exception hierarchy and allows PHP code to interact with PHP code which isn't written by the developer knowing that there's a common interface (such as getMessage()) which the exception always adheres to. That improves the ability of exception handling especially debugging and logging significantly.