On Sun, Feb 22, 2004 at 05:44:43PM +0100, Erik Franz�n wrote :
> Markus Fischer wrote:
> > The catch-all helps catching any type of exception, _given that_ it
> > is derived from class Exception. The motivation behind it, and this
> > makes sense to me, I'm pro this behaviour, is, that this way the
> > interface of the Exception class is well defined. You can always
> > count that you have the methods getMessage, getCode, getFile,
> > getTraceAsString, etc. Which is IMO good.
> >
> > - Markus
>
> With this behavior you force the developer to use the exception class.
> You cannot use your own class because PHP will trigger an error if you do.
>
> However, you can of course extend the exception class with your own
> class, but you cannot replace the default methods (getMessage etc) since
> they are final.
>
> I don't like this, since you are forced to use the built in exception
> class which also has final methods. Where has the feeling of freedom gone?
Your point is true. Why getMessage() is final I don't know. My
development with PHP5 has only started a month ago, but yet haven't
run in any limitations by this although I'm making heavy use of
Exceptions and Object-Code.
- Markus
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php