Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109212 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61758 invoked from network); 22 Mar 2020 23:09:15 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Mar 2020 23:09:15 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 945641804E0 for ; Sun, 22 Mar 2020 14:33:10 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f172.google.com (mail-vk1-f172.google.com [209.85.221.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 22 Mar 2020 14:33:09 -0700 (PDT) Received: by mail-vk1-f172.google.com with SMTP id r129so3267697vkr.6 for ; Sun, 22 Mar 2020 14:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X216FPCMGiygFCleuzyI8HntX2aBXpQsbb+tlv6xwYA=; b=UCUuO98VTu+2AQ1mocGS2BMcAjWaedPA3jYACRkCIknIMZObX1Ql5PfyBpGVaSHdBz kYEkNd2jnxWOXUR0PXHPMQNs0gh3TJ6trdRw6cF9MKr5PPJrIXKFUotjy173EMW7uYgs ExJUfqPaM6lay/ctYDOtcqbAN44GGD3Lzt1y9e/DEzDz7duwRvnW4AB4Rbsnkj2X7KR5 x8wqcO7Xc4kBYtYP0ZxU3dItZmLtWxQdesmgjwDi9JjETR1Tz1fbYaNRLJ34LNBzq4vf tSi44iXCgDGLd4RyQKib+QnhAPYh0D0P9WyW2t6zvYYMLEczVq8C/OMC+tUthy9RzM4f B5pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=X216FPCMGiygFCleuzyI8HntX2aBXpQsbb+tlv6xwYA=; b=Djd8DyFgeRwSGspUjDWxGnC9bc9mlDj76CCojtkAhXQteT5dmyNvt4jLWaV2w95wTb NMvcKrfShhls5ySlmB6KKpyUZ6OGQpDi/A9Sui/B1pDRyd+3WOi7tc9xYYM/i2KeRoWn a3KFrqUSGd2rLKzNM00QeeGHFHaA01sTi9faSP4XoI+r2eiKGFfpbGghFaeS9Lo2QFHL tq2gK6ckRePbTrUfkO4kASvFNW5tycQBaOyXqfHnpRSra3xTOXOGERZjlrx3tJ6VqroM 2uTlj56Zpr1dcAh/jzUMZYorDtVGN73Di8I5MYBZizSXmzw/HXMzTB3vuG7/SH7m6uSc q0PQ== X-Gm-Message-State: ANhLgQ2Ex2eqLqjgEpnDgcJ13raBBRvpet2yuyGFnnD/LLYTP7u6KR/A TQlDTQE3n1BfmZpqru+epDPqQEhrev87P64SjjlnWw== X-Google-Smtp-Source: ADFU+vsxzFw1FZmR21HY4GrSzwd+cWlpGwXHEDYwU106PF6e6EHVOlJ7TgTTKCNialu85rPc1b5Luy/6QHy3ldwugH8= X-Received: by 2002:a1f:c944:: with SMTP id z65mr12538700vkf.82.1584912788887; Sun, 22 Mar 2020 14:33:08 -0700 (PDT) MIME-Version: 1.0 References: <5BEF8264-4003-4056-A31C-FF8BEE85FED6@me.com> In-Reply-To: <5BEF8264-4003-4056-A31C-FF8BEE85FED6@me.com> Date: Sun, 22 Mar 2020 17:32:57 -0400 Message-ID: To: Ilija Tovilo Cc: Internals Content-Type: multipart/alternative; boundary="000000000000c81adf05a17843ab" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] throw expression From: matthewmatthew@gmail.com (Matthew Brown) --000000000000c81adf05a17843ab Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I think this is great. It reminds me of a construct that Hack introduced called "as expressions": With throw expressions the Hack assignment, `$a =3D $b as string;` would be equivalent to the PHP assignment `$a =3D is_string($b) ? $b : throw new TypeError('$b must be a string');` If this passes, it would be great to see sugary equivalents get added to the language too. On Sun, 22 Mar 2020 at 12:17, Ilija Tovilo wrote: > Hi everybody! I hope you=E2=80=99re doing well. > > > > Due to the modest feedback I=E2=80=99d like to move the throw expression = RFC to > =E2=80=9Cunder discussion=E2=80=9D. > > https://wiki.php.net/rfc/throw_expression > > > > In short, the RFC proposes to convert the throw statement into an > expression to make it usable in arrow functions, the coalesce operator, a= s > well as the ternary/elvis operator. > > If you have any feedback, concerns, or if you want to express your > interest or lack thereof, let me know! > > > > Regards > > > > --000000000000c81adf05a17843ab--