Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109207 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 23919 invoked from network); 22 Mar 2020 19:56:59 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Mar 2020 19:56:59 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4C71F1804B8 for ; Sun, 22 Mar 2020 11:20:57 -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,MIME_QP_LONG_LINE,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-qufo17291701.me.com (ms11p00im-qufo17291701.me.com [17.58.38.46]) (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 ; Sun, 22 Mar 2020 11:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1584901253; bh=CkCdWivPGtdymwi3R4aRXWJqZ56zo+iZPeQX96FsKNM=; h=Date:Subject:From:To:Message-ID:Content-type; b=QW1j7M2BeqtWhXJLjvQ3jtSWfvxrHEzEXf5Dx4X+fktwUFM3fT7Uf3oLjRpZAntp7 CDHZ59nxm+Xcib1VMxD9uw22b+YOEUIl9K96RloDGYrW7gMNLYnkUSg9lpKpGn1h4J /rK3gdHEuCznXEO724nCOpGkknLCXSaTCVS8uL+Ydf1nOi6QfJ6rVjQpDq5gGyZOuJ 7IIgrTlbJCpJOpBXGtO3eH8lSuhkN3t3saAuHoCDdwfCuxpgPaH1ke8ya3EW/kvtWe 3+t97sAqpPS6yqDiyaXG8+vR65/wAHjG2jilFc9kTSBq9d/7fVcxP2MIgJV2Gdc4bA hnYkGn7DEgoJg== Received: from [192.168.1.106] (9.66.194.178.dynamic.wline.res.cust.swisscom.ch [178.194.66.9]) by ms11p00im-qufo17291701.me.com (Postfix) with ESMTPSA id 13FBB6402FD; Sun, 22 Mar 2020 18:20:52 +0000 (UTC) User-Agent: Microsoft-MacOutlook/16.35.20030802 Date: Sun, 22 Mar 2020 19:20:47 +0100 To: Dan Ackroyd CC: PHP internals Message-ID: Thread-Topic: [PHP-DEV] [RFC][DISCUSSION] throw expression References: <5BEF8264-4003-4056-A31C-FF8BEE85FED6@me.com> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2020-03-22_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=977 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-2003220111 Subject: Re: [PHP-DEV] [RFC][DISCUSSION] throw expression From: ilija.tovilo@me.com (Ilija Tovilo) Hi Dan Interesting suggestion. I'll have to think more about how many of these var= iations there are and if there's an easy way to recognize them. Ilija =EF=BB=BFOn 22.03.20, 18:16, "Dan Ackroyd" wrote: On Sun, 22 Mar 2020 at 16:17, Ilija Tovilo wrote: > > Due to the modest feedback I=E2=80=99d like to move the throw expression RF= C to =E2=80=9Cunder discussion=E2=80=9D. > > https://wiki.php.net/rfc/throw_expression > =20 Regarding the example: =20 $condition || throw new Exception('$condition must be truthy') && $condition2 || throw new Exception('$condition2 must be truthy'); =20 The "Deprecate left-associative ternary operator"* RFC made it so that parentheses are required when ternary operators are nested in complicated statements. =20 Would a similar requirement for parentheses around complicated throw expressions be a suitable solution to avoid people being surprised by the behaviour? =20 cheers Dan Ack =20 * https://wiki.php.net/rfc/ternary_associativity =20