Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:188 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1938 invoked from network); 23 Mar 2003 15:44:36 -0000 Received: from unknown (HELO carmine.bestweb.net) (209.94.102.73) by pb1.pair.com with SMTP; 23 Mar 2003 15:44:36 -0000 Received: from [192.168.1.100] (unknown [216.179.71.153]) by carmine.bestweb.net (Postfix) with ESMTP id D618E2420F; Sun, 23 Mar 2003 10:44:40 -0500 (EST) To: Wez Furlong Cc: Stanislav Malyshev , Sebastian Bergmann , internals@lists.php.net In-Reply-To: References: <1048432076.848.2130.camel@hasele> Content-Type: text/plain Organization: Message-ID: <1048433146.847.2158.camel@hasele> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 23 Mar 2003 10:25:47 -0500 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Throwable interface From: sterling@bumblebury.com (Sterling Hughes) On Sun, 2003-03-23 at 10:33, Wez Furlong wrote: > We need to do at least one of the following: > > 1) Force all exceptions to be descendants of a builtin Exception class > 2) Force all exceptions to implement a Throwable interface > 3) Provide a catch-all syntax to the language for exception handling. > > This is *extremely* important for people writing such things as SOAP or > RPC servers that want to keep their implementations as robust as > possible. > > While we are at it, lets have the call to undefined method fatal error > and the type-hint checking raise exceptions too; procedural code will > still bail out if it doesn't catch the exception, while robust OO coders > will be able to act on the event and handle it gracefully. As mentioned over IRC. Why do this with Throwable (which raises the WTF factor), why not just add a generic default case: try { throw new Bar; } catch ($e) { // do stuff with the exception } sure introspection will suffer, but I'm against anything that forces a developer into a contract they may not want to make. -Sterling -- "Science is like sex: sometimes something useful comes out, but that is not the reason we are doing it." - Richard Feynman