Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92433 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90934 invoked from network); 19 Apr 2016 00:43:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Apr 2016 00:43:32 -0000 Authentication-Results: pb1.pair.com header.from=bishop.bettini@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bishop.bettini@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.194 as permitted sender) X-PHP-List-Original-Sender: bishop.bettini@gmail.com X-Host-Fingerprint: 209.85.214.194 mail-ob0-f194.google.com Received: from [209.85.214.194] ([209.85.214.194:34991] helo=mail-ob0-f194.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/F0-11975-23F75175 for ; Mon, 18 Apr 2016 20:43:31 -0400 Received: by mail-ob0-f194.google.com with SMTP id 4so66465obi.2 for ; Mon, 18 Apr 2016 17:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CxdSCbA5MBVRCRo8VSu9Ht1bjbIvp5MRghg7/5HTJM4=; b=oyzajYhVw0ErOZcLOU79zModWp5ERJ5NIpmV4JhI3Ix/kSTJR/k+aweBaTfWVSPbrf SdLdOtyf1E1ckrOujQKdafMYsiKytLCEQmAzUd3fdUVSrDCwEwAE68bwaQlbET3mt8EJ JP8+Upexb4pjwHnBvHswi1kFMw+jF5f7WD601b/LN1CFcf6ye/p0Ik6OJIIGFkPrgLgJ JF79GgxDzHptxKNqD4uXFlY6nUAHrR+IGA0qmYbwPjpuH6LszfLattaLQmSqVsbyz0S/ +ajsXFagX/diJwu5H67Ubs8GGQ19YK58YWlRBCG1bEVo/gis7aSuP2asClwnT2WaSq9I oU9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:sender:in-reply-to :references:from:date:message-id:subject:to:cc; bh=CxdSCbA5MBVRCRo8VSu9Ht1bjbIvp5MRghg7/5HTJM4=; b=hhME0UDE4JWaA8zsEqBlIg5gW1bvvwU7s2yJCoi0hcdRzyOoai/tzLTOftdEMErWzH PB+K7by4iboPFhg3VnEjVaCIM0iuvpdxSi0Fs1R8cA3mx0/af8cmMNOjgjQrvn2fqt5+ lo70CBPB6tuFlxRkCk6jPy0qoUy2pOtAVX3LU1gjGhRCYGfUDJ0bgruemqaLqq8ZpIAq u7QLszpRzPagELZyOsjo1L3VS6KBM0n2iJTL6bFmZ5kTYpxkAaIhcSpqRnScNVydSgZC kAVFCsunx9biZnVuCby1X4fsiUdgVqRWchahRBIq/yYcFIMwUPeM1VZLzx+lwXMy0hv2 i+ow== X-Gm-Message-State: AOPr4FXEJFq34j8Qz8YxPl5QpyNW/fpnnCFdf8pKvSgUPKGbJolZ+YC8jlYCWTTRm7NUVtFqmkmjYWNliZBbyQ== X-Received: by 10.182.53.234 with SMTP id e10mr17433obp.54.1461026608013; Mon, 18 Apr 2016 17:43:28 -0700 (PDT) MIME-Version: 1.0 Reply-To: bishop@php.net Sender: bishop.bettini@gmail.com Received: by 10.157.36.137 with HTTP; Mon, 18 Apr 2016 17:42:58 -0700 (PDT) In-Reply-To: References: Date: Mon, 18 Apr 2016 20:42:58 -0400 X-Google-Sender-Auth: 4KhkOJC98ma4cOCRw-0krwpxau8 Message-ID: To: Marco Pivetta Cc: Dan Ackroyd , =?UTF-8?B?QnJvbmlzxYJhdyBCaWHFgmVr?= , PHP internals Content-Type: multipart/alternative; boundary=001a11c1c00cfa66ee0530cbc387 Subject: Re: [PHP-DEV] [VOTE] Catching Multiple Exception Types From: bishop@php.net (Bishop Bettini) --001a11c1c00cfa66ee0530cbc387 Content-Type: text/plain; charset=UTF-8 On Mon, Apr 18, 2016 at 9:40 AM, Marco Pivetta wrote: > > I voted "NO" due to previous discussion. TL;DR: this is FAR off the 80/20 > use-case for a language syntax change. > > ... > These 3 exceptions usually result in separate handling anyway. If same > handling is needed, you can as usual extract a private method (if you are > in a class) and deal with it there: > > ... > Still, even in this case, I'd flag it up in a code review, as same handling > for 3 different exception types generally (not always) means something is > really wrong. > > So we are building a feature for a 1% case that, while simple to implement > at parser-level in PHP, requires changes in all userland libraries that do > parsing or rely on the AST. > I agree: the times this need arises are relatively rare, and in those cases functional encapsulation cleanly handles the repetition. I would vote no, were it not for one thing: union types . catch constitutes a formal signature, exactly like a function signature. In my mind, this proposal and the union types proposal are intrinsically tied. If we have one, we must have the other. If not, we're inducing a sadness. Since I do see the need for union types, and since I believe the two must be accepted or rejected together, I voted yes. --001a11c1c00cfa66ee0530cbc387--