Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92440 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5933 invoked from network); 19 Apr 2016 03:01:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Apr 2016 03:01:29 -0000 Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 66.111.4.26 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 66.111.4.26 out2-smtp.messagingengine.com Received: from [66.111.4.26] ([66.111.4.26:57668] helo=out2-smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A1/93-11975-78F95175 for ; Mon, 18 Apr 2016 23:01:27 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6DA8720D5E for ; Mon, 18 Apr 2016 23:01:24 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Mon, 18 Apr 2016 23:01:24 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=eNkyDtKp9cuQJey VFlWjX/v29cM=; b=TUYGk3RacykyfAEISOS4UemP0UOtxP5UM7+sq5/WpbbhURu 5yVoM9UmtqMq8lXfwQULRkFQU0PySxDWxYoPEBh/sZkSAfyvdxf3r+ckxL59hrDe wNrFBlKLB/qvhUhZsZlkuokybyUpvhPr2r4exB8uIbAI/2Vv9PeN8SJLicQI= X-Sasl-enc: qSQ3d5y/tekFfrhS4Gx7lvVPiwZxgXKhKx5sd+gxh831 1461034877 Received: from [192.168.42.5] (c-50-178-40-84.hsd1.il.comcast.net [50.178.40.84]) by mail.messagingengine.com (Postfix) with ESMTPA id BE719C00028 for ; Mon, 18 Apr 2016 23:01:17 -0400 (EDT) To: internals@lists.php.net References: <571581C7.7010901@gmail.com> <571589AF.3090502@gmail.com> Message-ID: <57159F7D.3050200@garfieldtech.com> Date: Mon, 18 Apr 2016 22:01:17 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <571589AF.3090502@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [VOTE] Catching Multiple Exception Types From: larry@garfieldtech.com (Larry Garfield) On 04/18/2016 08:28 PM, Stanislav Malyshev wrote: > Hi! > >> It's about the perception of consistency. "Oh, I can do this! Neat:" >> >> function neat(Foo | Bar $a) { ... } > You shouldn't be able to do this, because it makes no sense - why would > a function accept two random types and only them? That's probably a bad > design - it should be one type or two functions. I detailed use cases for both & and | here: http://news.php.net/php.internals/92335 Admittedly Foo|Bar is of limited use, although there is some use. Foo&Bar, however, has plenty of uses. I do agree with the sentiment that having Foo|Bar for catch but not for function signatures is going to confuse people. If nothing else, it will result in even more pressure to add union types. --Larry Garfield