Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89886 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75564 invoked from network); 24 Dec 2015 22:45:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Dec 2015 22:45:21 -0000 Received: from [127.0.0.1] ([127.0.0.1:18080]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 30/90-51216-1857C765 for ; Thu, 24 Dec 2015 17:45:21 -0500 Authentication-Results: pb1.pair.com smtp.mail=after89@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=after89@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.44 as permitted sender) X-PHP-List-Original-Sender: after89@gmail.com X-Host-Fingerprint: 209.85.215.44 mail-lf0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:34980] helo=mail-lf0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/80-51216-0647C765 for ; Thu, 24 Dec 2015 17:40:32 -0500 Received: by mail-lf0-f44.google.com with SMTP id l133so166954325lfd.2 for ; Thu, 24 Dec 2015 14:40:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=N/UCbZWTzhODY/gNkGb3rbYwqYdO6M+3HBrhNi4tnyo=; b=PrEbk4r6J+RzaCocebwdEV8zHDkp1N5+XWB00KLYsCvO69wVeWhIJtyu1CnLCaQiqv dU6cCie1FRTT49kmaylCQ0ecWuBRNxrMQPgrFXYr7jl/20BcGPLf5ByCTYyzXPjQXJIB 5OLBsAfM4WgAF1KGSR2fxBA72IkZb4O9qpcKl4XYe96a6JTw3VY7XdRAyWVZYEcxJJUZ rjpZIwyIi6grzHIx9dzXlwextmBeYiRq9zHimhl4gJxqHCF28eCxWxYTVCcydC5Y/T8g dw1IXTwGIn/Rngwqktzy/OO6RTtxqRD43n0MADyUlJQ8BU0TjDs1trEOfhaFWAQS/uch 20bg== MIME-Version: 1.0 X-Received: by 10.25.145.81 with SMTP id t78mr13157274lfd.86.1450996829332; Thu, 24 Dec 2015 14:40:29 -0800 (PST) Received: by 10.112.7.5 with HTTP; Thu, 24 Dec 2015 14:40:29 -0800 (PST) Date: Thu, 24 Dec 2015 23:40:29 +0100 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Multicatch RFC proposal From: after89@gmail.com (=?UTF-8?B?QnJvbmlzxYJhdyBCaWHFgmVr?=) Hello everyone! I've just created an RFC draft for catching multiple exception types in one catch statement: https://github.com/bronek89/php-multicatch-rfc I wrote RFC on github to check if there is any positive response from commu= nity. Basically it introduces possibility to write code such as: try { // ... } catch (DbException | ResourceNotFoundException $e) { throw new HttpException("not found", 404, $e); } catch (\Throwable $e) { throw new HttpException("fail", 500, $e); } Provided patch is my first experience with PHP source code, so it could be not perfectly written (or simply poor ;-) ) . What do you think about introducing that kind of feature into PHP? --=20 Regards, Bronis=C5=82aw Bia=C5=82ek.