Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109489 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 98056 invoked from network); 31 Mar 2020 21:34:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 31 Mar 2020 21:34:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ECB59180504 for ; Tue, 31 Mar 2020 13:01:11 -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,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-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) (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 ; Tue, 31 Mar 2020 13:01:11 -0700 (PDT) Received: by mail-io1-f66.google.com with SMTP id i3so13976141ioo.13 for ; Tue, 31 Mar 2020 13:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jQ9hAufAIoSE6N17iJne2ZZ67OiXGuSaNUBJvZRIJ40=; b=XBWgrR/JjkX2d0IvMQp15HovCm+29DEV94e/kGOvp3d1fnDhXeoZc4IchpkZrdrgNR XM8V8MIXEBTmOPGHCeCrAV1Kn21YtqgBgSwfX3PutLScYfYHc3hO6aKjlu+WTUtnhHTX MjD+EpIqi655BoQtspgNuDjuBl81DX/8rCK08= 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=jQ9hAufAIoSE6N17iJne2ZZ67OiXGuSaNUBJvZRIJ40=; b=JM4grNAlcPprx8D+ZnBZIcXpUjunNbl5plY/bDuuSTQak4EjdL3lEa54F2CrtJ4hf9 O0hgrY0Fs2rkrkFo6m7dusC2L8cS0uagK4FHV/q63KM/L5+TtsZ8oXUYLOZpuOAQ/Ebn I6x5TgUmyPlAwszQ0Q2K5ysrKjO/bKD/SMBpQ1lXp3dLxTRioJyDh33Na5mndDKXnZqJ xJ07ODSnxnOAQR7XsTNoUREotH/bQ/hI8qnGH2lcjDV90+2jcnbfsii4oqs7JsOyY2N+ Q6JNXy8hgVnu/dCkRmDAzDC5yL/K2+Mxn2WYw/cFSUMwiyJF8ZakYgMQFph5XzJn0VjL GvZA== X-Gm-Message-State: ANhLgQ0EWC0zy5WLw0oWPakhiNNErpWKCcXXNGa3AzPr2r9X3JFGIldg GKy+Z5fO2HCEZU+KyPedvkBgXC6RN2Gr9LzITfQFbA== X-Google-Smtp-Source: ADFU+vsc82n0wwKN0mJXtid2J3bDS6TgeOjjSw5pCuj1bPzbHFrla1Bg5SOKJ9WIoPenzwEkASSkmcXpsvUYZbIllSc= X-Received: by 2002:a5d:80d6:: with SMTP id h22mr16816788ior.177.1585684867684; Tue, 31 Mar 2020 13:01:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Tue, 31 Mar 2020 14:00:56 -0600 Message-ID: To: Ilija Tovilo Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC][POLL] Switch expression From: internals@lists.php.net ("Levi Morrison via internals") On Tue, Mar 31, 2020 at 12:51 PM Ilija Tovilo wrote: > > Hi internals > > A few days ago I opened the discussion on the switch expression RFC: > https://wiki.php.net/rfc/switch_expression > > There's been a fundamental disagreement on what the switch expression > should actually be. Due to the conflicting feedback I no longer know > how to proceed. This is why I've created a poll to get a general > feeling of what approach is preferred. If you can vote, **please**, > vote. > > https://wiki.php.net/rfc/poll_switch_expression > > Ilija > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > To be clear, you actually could reuse the switch keyword for an expression: $x = switch ($y) {/* ... */ }; It's a bit tedious to do but it's not ambiguous. I did a similar thing in the past when working on short closures. I tried using `{$x => $x *2}` for the syntax and had to disambiguate with an empty block (which serves no purpose in PHP). I can't find the branch/patch anymore, which is unfortunate, but it is doable if you are determined.