Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91582 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58676 invoked from network); 9 Mar 2016 11:52:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2016 11:52:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Received: from [82.113.146.227] ([82.113.146.227:48604] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/F0-53667-96E00E65 for ; Wed, 09 Mar 2016 06:52:10 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 03C1A10C01C; Wed, 9 Mar 2016 11:52:06 +0000 (GMT) Date: Wed, 9 Mar 2016 11:52:06 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Pierrick Charron cc: internals@lists.php.net, =?UTF-8?Q?Bronis=C5=82aw_Bia=C5=82ek?= In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1459758708-1457524327=:3594" Subject: Re: [PHP-DEV] [RFC Discussion] Catching multiple exception types From: derick@php.net (Derick Rethans) --8323329-1459758708-1457524327=:3594 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Hi! On Tue, 8 Mar 2016, Pierrick Charron wrote: > Bronis=C5=82aw Bia=C5=82ek and I would like to start a discussion about a= llowing=20 > multiple exception types to be caught in a single catch statement. >=20 > https://wiki.php.net/rfc/multiple-catch Would it not be better, to have your Exceptions extend a common base=20 class in this case? Or perhaps, which I think is even better, to have=20 your Exception classes implement a common interface that you can catch=20 against. That I believe should already work. What you are asking PHP users to do with a multiple catch like this, is=20 to test in each catch's statement block to test for each class again.=20 Neither the inheritence or implements options from the previous=20 paragraph have that issue. cheers, Derick --8323329-1459758708-1457524327=:3594--