Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109311 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89600 invoked from network); 25 Mar 2020 21:12:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Mar 2020 21:12:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A15B11804FD for ; Wed, 25 Mar 2020 12:37:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, MALFORMED_FREEMAIL,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS714 17.58.32.0/20 X-Spam-Virus: No X-Envelope-From: Received: from ms11p00im-qufo17291301.me.com (ms11p00im-qufo17291301.me.com [17.58.38.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 25 Mar 2020 12:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1585165034; bh=HtaBFjU00koWaPNBxxmasttx9Yk1PASExZQFFL9JAio=; h=Date:Subject:From:To:Message-ID:Content-type; b=BmPUKKxZX3inb2oV2jJBZ3uwVDo0YHmC0/KlwOyhfNoKV7VPNLe7WPrEWyMBxoeAp sF0KIg6XARMbpr1X9zyO6geSc76WgapmgcPEgC8FER0QrGamZB+bVBZ+NuWBcWGyK3 dZP4vUnZ/u9oZOmD9deYpo8T/FPYg/s2ZU1Fi6o42aZj0bGlMG0CLqA5foUogSQA0Q KoIxO086dLlmRYZUCCpMtTjuq/SvTcmnl+a9A9sg89rITv1L6U30slX9OsfP0MmAYb 6VAbyfA/TRftw3EBc73q+oXc/BGuADqn2zH9+mwJALPgUizID0QuuMBsFZ0yzFemje j37R5nVEQ78fw== Received: from [192.168.43.208] (197.226.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch [178.197.226.197]) by ms11p00im-qufo17291301.me.com (Postfix) with ESMTPSA id 1328810170B for ; Wed, 25 Mar 2020 19:37:11 +0000 (UTC) User-Agent: Microsoft-MacOutlook/16.35.20030802 Date: Wed, 25 Mar 2020 20:37:02 +0100 To: Message-ID: <45336017-C447-410C-8352-10B29B505137@me.com> Thread-Topic: [PHP-DEV] [RFC][DISCUSSION] throw expression References: <5BEF8264-4003-4056-A31C-FF8BEE85FED6@me.com> <20200325191228.3A3D77402ED@mr28p00im-smtpin019.me.com> In-Reply-To: <20200325191228.3A3D77402ED@mr28p00im-smtpin019.me.com> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2020-03-25_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=489 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-2003250156 Subject: Re: [PHP-DEV] [RFC][DISCUSSION] throw expression From: ilija.tovilo@me.com (Ilija Tovilo) Hi Andrea > I would think we can just give `throw` an appropriate precedence so that expressions like the above do what is desired The example are taken from the RFC online. The following expression is already possible: ```php throw $condition1 && $condition2 ? new Exception1() : new Exception2(); ``` To make sure it keeps working the precedence needs to me very low. Thus the precedence might be slightly surprising which is why Dan suggests printing a warning. Regards