== Quote from Timm Friebe ([EMAIL PROTECTED])'s article
> It's basically the same with the built-in exception class. I can't have
> my own (at least not with the sexy-most name "Exception"). Then, in my
> (very personal) view I want it designed differently, and want to have it
> extend _my_ base class (which, incidentally, is called "Object" and does
> _not_ have constructor:)) - again, this is _my_ very personal feeling
> about how it should be - so I'll just have my own exception, which is
> perfectly OK and dealt with very well by the Zend Engine.

Exception is a very good example why I think sharing a common base class is necessary 
(I also posted a message on that). Imagine I use my own exception base class, and you 
use your own.
Now what will happen if I get some code from you? I will have to review all my code 
and verify everywhere I want to catch all the exceptions (kind of "finally" clause), 
if one of your exception classes could be thrown and then add your base class in the 
catch list. Not so easy and prone to bugs.
To avoid that, either PHP should implement a generic catch (like C++ "catch(...)" or 
"finally") or we have to share the same base class, which could be empty or be an 
interface.

Many OO languages impose base classes and, for sure, they can not implement all 
everybody needs, and may sometimes be contradictory with your expectation, but this is 
a constraint we should accept to simplify programming and particularly code sharing.

Regards,
Stephane

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

Reply via email to