Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92436 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96120 invoked from network); 19 Apr 2016 01:09:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Apr 2016 01:09:39 -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.218.65 as permitted sender) X-PHP-List-Original-Sender: bishop.bettini@gmail.com X-Host-Fingerprint: 209.85.218.65 mail-oi0-f65.google.com Received: from [209.85.218.65] ([209.85.218.65:35575] helo=mail-oi0-f65.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/F1-11975-25585175 for ; Mon, 18 Apr 2016 21:09:38 -0400 Received: by mail-oi0-f65.google.com with SMTP id r186so207312oie.2 for ; Mon, 18 Apr 2016 18:09:38 -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=cnsnQzTiGIrjM1Ouz6KHQqpD+xsGZn0Q5SokWzfex/A=; b=fkLECmUj5hyBggcge1hoK8gB7S6vYV3V6+uUPH3O9BFTjpHDyBiNJBCGSpIyN1nd4E Q3U/DfG539o56SNM04Pls872MpsQr7AFvihfIh/bRYvPZJ5MlEvH7p8CHLoR40Myzsp4 i0HGPNl9is+Q0cBpX56BbvHLTGFrwpyedcIE61rHaT7YGatr78bQKhCUhTgH+G5nr7UU 5to6vP7hiX5pjlnYBs0SHWUbxeULdFSiu5iIi6qISGqPnFEcSRCqcS3/Rp30Ool3rTt4 WoBzjKPnK9hyxc2kjhHqGvNeKeJcIz8V0tJjbW6FZrvM10mNpxp0H7pyVZmdos7bM8ka Z/ng== 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=cnsnQzTiGIrjM1Ouz6KHQqpD+xsGZn0Q5SokWzfex/A=; b=cPm6cIxFmP4ya0q/KkhLd6MdrDVG6pv5keq2uRFCA4sjw9tuhtp/04WxxerPmnLWeT lV5o0+UfIQk1FwNgemTVMotnbAeI9xxycns4VdZ8lBnlrPZ54olGA8CjJCTCiQMw4wwT 6UwcfswWT5KxHxhb+MTRDr7FJMZgWFjFSjrvZU1hMJ17b98UcZ/qDPVIjS9bYdZBSse1 XIWkLs99i3yDcmRng6qp/EuBfWwSMYSX3UcTGtxNl3sEmK9c4Eh6pnDJWh4C5aJPfdQ1 CcB666J5oo1ylLmS8euEsu96oLjSnJAM44UftwjQSGm4br96XMZgmzXgfdH9Su4Pl6St aYKA== X-Gm-Message-State: AOPr4FVKDaU81/9ROjuM7DMZDu9xMjs46RoH2bwvGTptZ3+Yz4EvTUAVRr2epfq+7nY7D6ADqm7SEljj4g78+Q== X-Received: by 10.202.189.10 with SMTP id n10mr53954oif.101.1461028175963; Mon, 18 Apr 2016 18:09:35 -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 18:09:06 -0700 (PDT) In-Reply-To: <571581C7.7010901@gmail.com> References: <571581C7.7010901@gmail.com> Date: Mon, 18 Apr 2016 21:09:06 -0400 X-Google-Sender-Auth: otE3iyqmtsMC-WH1NEvldVTV628 Message-ID: To: Stanislav Malyshev Cc: PHP internals Content-Type: multipart/alternative; boundary=001a113d74c46f6c050530cc21a2 Subject: Re: [PHP-DEV] [VOTE] Catching Multiple Exception Types From: bishop@php.net (Bishop Bettini) --001a113d74c46f6c050530cc21a2 Content-Type: text/plain; charset=UTF-8 On Mon, Apr 18, 2016 at 8:54 PM, Stanislav Malyshev wrote: > Hi! > > > 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. > > This has nothing to do with union types. It is just a shortcut for > repeated catch() clauses, it does not introduce anything into type > system, capture existing use case, and doesn't make anything more > complicated. While union types introduce a lot of new things, make > everything dealing with types more complicated and the need for them, > unless we import a real lot of other concepts like type pattern matching > is quite unclear. So I don't think this has much in common. > It's about the perception of consistency. "Oh, I can do this! Neat:" function neat(Foo | Bar $a) { ... } "But I can't do this? WTF?" catch (FooException | BarException $ex) { ... } And vice-versa. The perception revolves around the fact that both appear to be signatured, regardless of how they're implemented in the engine. --001a113d74c46f6c050530cc21a2--