Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110705 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14779 invoked from network); 23 Jun 2020 09:52:45 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Jun 2020 09:52:45 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 83E031804C2 for ; Tue, 23 Jun 2020 01:39:54 -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-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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, 23 Jun 2020 01:39:54 -0700 (PDT) Received: by mail-lf1-f53.google.com with SMTP id c21so11196345lfb.3 for ; Tue, 23 Jun 2020 01:39:53 -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=8jF+30NHju71eMln7KSp+9qjzvGLV4+UsI0hVc0tIWo=; b=dZUt0jgBueLgPDjthtyKFQSBFm/tGPQkbdrrwKdr8zjwtfLeYPRQ9RaM3jfKwuCQk/ wK3o9G/P6fLaDVDXz6DaPU5qMv1LPd8+l7wdmeaYLW5x+E0lQ83sI7CXqSl0N3UbY51D zSaBUKdt/kQ/LkmYQC89u6zZ8PN/b90KVbI1CcRMD4unp98YE9R8VmH0GOIGVhpeeZvk Lzh58j123l65JOhuF7kR7CXF62ARZBLgSjNdr+LB362uW+aIkP4BvpgUybK8VhfkEVLw iZi6/15/oYkkpie31o/EKql4AyPBjiSBIuvjXrvWEEEMkhtaiFlDMt/nSDhre6vQ7+C5 c6Dg== 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=8jF+30NHju71eMln7KSp+9qjzvGLV4+UsI0hVc0tIWo=; b=oxeNoLYqnwjsvNzbvpd12hgz0k25Yfo0+hI679zxrD8fOyMy5tXu4RQyvp5huFlSss o/petML9hCXtD7OiRyNSrZDcd0oh1FkJ1Jb8rBFv+jXakOh05CofbWcrb+mBqi35TnuR aAmcg68HtnQffka1M/UyHisGMumHSO7A/7mYrsoleQPY4qgCxT81LTWeEFaABhetFllS q9RFd6aSqmLbFYjEOZaqGCVjadQJe5uhImGreCKIXiKsD2LAnKGhNgtkThvZVbhbYCMt 52sCsIwDtzBu9MHBCqKw6/yYsNOpjsjr4KGQPAmdWRrhBYvRrU7RCCExxOtPi0ogjaxJ utig== X-Gm-Message-State: AOAM531EBXjcP2mPUzD+6gS33V6Api6RibfLAm4luZSD1VxxFLHcg9Z2 kUB234wPKlok7umMbiwIXhHGAa6SbUA+vOBE1o4= X-Google-Smtp-Source: ABdhPJxxvhcffejjU51mx0kCEY2TCKgYHPbFwhShlxipoekqzVph+/QE+2gekDGUN+3ds1fGPsnkVL9XITLy9wx7fcE= X-Received: by 2002:ac2:4422:: with SMTP id w2mr11864442lfl.152.1592901592587; Tue, 23 Jun 2020 01:39:52 -0700 (PDT) MIME-Version: 1.0 References: <37f1f8fb-0e1b-cc39-f4b6-6c943a731d49@telia.com> <250b7671-2919-9385-c149-931212397e4b@telia.com> <04d86e2d-0815-195a-6111-3034e0ca5918@telia.com> In-Reply-To: Date: Tue, 23 Jun 2020 11:39:39 +0300 Message-ID: To: Ilija Tovilo Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000096a02b05a8bc4d73" Subject: Re: [PHP-DEV] Re: [RFC][DISCUSSION] Match expression v2 From: benas.molis.iml@gmail.com (Benas IML) --00000000000096a02b05a8bc4d73 Content-Type: text/plain; charset="UTF-8" Hey, On Tue, Jun 23, 2020, 11:34 AM Ilija Tovilo wrote: > Hi Benas > > >> I'd like to announce the match expression v2 RFC: > >> https://wiki.php.net/rfc/match_expression_v2 > > > Then it's not a standalone expression but a block. In this case, you > cannot add an optional semicolon at all. > > > > But this RFC v2 is not proposing to add a block, therefore you won't be > allowed to use `match` construct as a standalone expression anyways. > > Using match as a standalone expression is definitely allowed, just > like any other expression. > > // This is fine, the semicolon is required > match ($foo) { > $bar => baz(), > }; > Yup but it won't return you out of the function. For example, this wouldn't work: ``` function test(int $value): bool { match($value) { 0 => false, 1 => true } } $test = test(1); ``` But it seems by standalone expressions, Bjorn meant your example. Sorry for the confusion, I thought he was referring to blocks. > Ilija > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --00000000000096a02b05a8bc4d73--