Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8050 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95692 invoked by uid 1010); 22 Feb 2004 16:45:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95667 invoked by uid 1007); 22 Feb 2004 16:45:25 -0000 Message-ID: <20040222164525.95666.qmail@pb1.pair.com> To: internals@lists.php.net Date: Sun, 22 Feb 2004 17:44:43 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: sv, en-us, en MIME-Version: 1.0 References: <20040222143721.96272.qmail@pb1.pair.com> <20040222145607.GA7239@gjat.josefine.at> In-Reply-To: <20040222145607.GA7239@gjat.josefine.at> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 213.132.107.228 Subject: Re: [PHP-DEV] PHP5: Exceptions must valid objects that are derived from class Exception? From: erik@nordicaudi.com (=?ISO-8859-1?Q?Erik_Franz=E9n?=) 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? /Erik