Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100489 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39273 invoked from network); 9 Sep 2017 12:18:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Sep 2017 12:18:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.192.176 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.192.176 mail-pf0-f176.google.com Received: from [209.85.192.176] ([209.85.192.176:33599] helo=mail-pf0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/C7-10715-00CD3B95 for ; Sat, 09 Sep 2017 08:18:10 -0400 Received: by mail-pf0-f176.google.com with SMTP id y29so7324509pff.0 for ; Sat, 09 Sep 2017 05:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=nY5LHxf6hvsuS4isDDmfPZujU/Gz2c2OVz9xMYCUK/0=; b=E6HicwasFnEyj+/VrqMxRux7QYkggcGTDRNIqraKHmMgsaET96+smZnJ3csaoePYU+ J764e2nhoJ9AzdchATOpIyljXFSdpjQiplMJ/c+rZY3DdssUL2x2zZNNnbj4AJODM+st Bi5HZdNYAnxSS9QlemOhMEyjQhW/6OhQ6/vdtVaaPyh33LxeDRL+duwftj0XyhPAagLB FViYhd70SuG6s+sL4etRw/jLCmP5+OaWFOewulVH2UMTU6dq+jXTnB5qXy8dg9ExlpjY LhCsc5NRhot/71SCc/cLeAbGAiXSRWurEYnWmoTIO1Tb7TB8RWVQzZH+YvqaTdG+EmF8 5AXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=nY5LHxf6hvsuS4isDDmfPZujU/Gz2c2OVz9xMYCUK/0=; b=mKIaDLRnW3ZvaR0/+bGll2kkDpIXXhncntkugbpPl1QCgfGA7TYjnTFHfgHZsVzc1T 9uNVb44nztQgidZMYPR1R10/ihYqUYPT89cG64qhqn/RsX9s9ZTzgCyEzcWwL12oq+S/ liCUKrrjoXSmEdseGBr8m2Q92/5t4NYSynH79kZXkZG2P2nGjwEPal9ocLExmjWnhR01 4O66guopzdH5MPJDshuD2X9HDKUaP7rWwDXOZt9Wveq6wggS8mXk2fNHGA8QUYNVXv+w Rpt8eZzE5whJeU/4w6PbQfLKMFpn6t+wcoxKzXNZWQZLygjPgInhBE7yJDrqMVC325W4 2c1Q== X-Gm-Message-State: AHPjjUhRrPwdIuRxzJGjKUvzfU0hSXosX/w/4t+I3kIUXgdpQNMjSDn3 8y+SFZ6r2q33FhfYI0RnEP2/GaRtStQx X-Google-Smtp-Source: ADKCNb4MSbORNbW4a/Ua+zZ9kB0AkHn7Z95vzWyiL1Yyg45v5v7JHFhOjiir+76XE1HNgY1mkSyTlPWz8fDIT2F6J9w= X-Received: by 10.99.115.21 with SMTP id o21mr6250312pgc.334.1504959484901; Sat, 09 Sep 2017 05:18:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.180.133 with HTTP; Sat, 9 Sep 2017 05:18:04 -0700 (PDT) X-Originating-IP: [77.99.17.151] In-Reply-To: <87.77.10715.B5AD3B95@pb1.pair.com> References: <87.77.10715.B5AD3B95@pb1.pair.com> Date: Sat, 9 Sep 2017 13:18:04 +0100 Message-ID: To: Andreas Treichel , Ilija Tovilo Cc: "internals@lists.php.net" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: [RFC] Match expression From: danack@basereality.com (Dan Ackroyd) On 9 September 2017 at 12:21, wrote: > Hi everybody! > > Has this idea been discussed before? > .. > Each case has an implicit `break` This part has come up before, as the default behaviour of fall through is a nasty gotcha for when you forget to put break. I can't find the conversation right now, but the discussion was around a 'select' keyword. I think the conversation didn't proceed as it seemed like adding a new keyword just to fix the fall-through behaviour was a bad tradeoff. This RFC idea adds more capabilities, so is a better trade-off, and more likely to be worth doing in my opinion. > One downside, since PHP doesn=E2=80=99t implicitly return the last statem= ent > as some languages do there=E2=80=99s no obvious way to do multi-statement= cases. People are still working on and hoping for short-closures. That RFC and any potential one for this, should attempt to use the same syntax. On 9 September 2017 at 13:11, Andreas Treichel wrote: > Something like: > > *wall_of_hard_to_read_code* Yeah, that's a pretty good example of why I'd be in favour of this RFC. cheers Dan Ack