Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17596 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84048 invoked by uid 1010); 8 Aug 2005 12:51:02 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 84033 invoked from network); 8 Aug 2005 12:51:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Aug 2005 12:51:02 -0000 X-Host-Fingerprint: 82.165.35.142 thinkforge.org Linux 2.4/2.6 Received: from ([82.165.35.142:28876] helo=mail.mayflowersystem.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 11/39-04646-53557F24 for ; Mon, 08 Aug 2005 08:51:01 -0400 Received: (qmail 30201 invoked by uid 60010); 8 Aug 2005 12:50:58 -0000 Received: from 84.150.123.61 by mail (envelope-from , uid 89) with qmail-scanner-1.24 (uvscan: v4.3.20/v4362. spamassassin: 2.63. Clear:RC:1(84.150.123.61):. Processed in 1.354288 secs); 08 Aug 2005 12:50:58 -0000 Received: from unknown (HELO ?192.168.1.9?) (schlueter@mayflower.de@84.150.123.61) by 0 with (RC4-MD5 encrypted) SMTP; 8 Aug 2005 12:50:56 -0000 To: internals@lists.php.net, tobias@schlitt.info Date: Mon, 8 Aug 2005 14:50:46 +0200 User-Agent: KMail/1.8 Cc: Sebastian Bergmann References: <42F7587B.6050901@schlitt.info> In-Reply-To: <42F7587B.6050901@schlitt.info> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200508081450.46458.johannes@php.net> Subject: Re: [PHP-DEV] type hinting throwing a fatal error From: johannes@php.net (Johannes Schlueter) Hi Toby, On Monday 08 August 2005 15:04, Tobias Schlitt wrote: > > The throw an Exception when SPL disabled and an InvalidArgumentException > > when it is enabled. > > That's senseless when writing applications that shall be version > independant. Just sticking to Exception should be fine. No it is not, in your application you can still simply catch Exception to be independent of SPL since the InvalidArgumentException class extends the Exception class. But by using nested Exceptions you can catch them independently. Else you would have to catch every Exception, parse the error message or trace to see wether it was a problem while calling the function/method or some code inside the function/method went wrong. I'd like to see something like what Sebastian suggested. And imho it wouldn't really be a bc-break since an uncaught exception is fatal, too. johannes