Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110116 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 56960 invoked from network); 10 May 2020 21:23:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 May 2020 21:23:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C52E01804CB for ; Sun, 10 May 2020 12:59:48 -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.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE 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-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (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, 10 May 2020 12:59:48 -0700 (PDT) Received: by mail-ot1-f52.google.com with SMTP id j26so5917780ots.0 for ; Sun, 10 May 2020 12:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ralphschindler-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=bi0qNzpWEKxqu4NJIRGiv/I9ei7QwZEiP7APyiq+V98=; b=o5O81lg/hEyr849BuqC91JKEpXs4llwgOzXKq242JIfNCwStBdXFY1n+yHfUcEl92o mKJRjZxdgQ8WkF3ZQoMSiS6G+j6zGDHNVGjJNCfR6cTjNV87cq6fdh6U7t4Fcfz3wixE 0e5K3M4rTjKbz+t+ZHKauz+t6tMGZzocPAeNfrxsVa3gy0i0/0QZDnZOLH9TqQjcIocx kKDlJlDlEWbkIFid/kH2ADry/95dBRxhoeZi3kAyRKylAeFqQAfX1JoexSd2ObO8pZSl CCvEWIPcBFAD/5zduOgNWtRbYLhwkIELUdlEubUrc1PFYh5BOP0pBe/Jc0gkuAlnYXYk PRNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bi0qNzpWEKxqu4NJIRGiv/I9ei7QwZEiP7APyiq+V98=; b=NTknJ8zUSN+/Lbbk8ngCEUXkiVBEWgZjBFF7mergLhtN6HoZt2iDiRrwQkMZFDlws6 WWIRSo7sIg8efqkLwoHKYJKE48jVh8m7kfWN8cWcV/Sr6hluRfO1lBMmwghq1QNH+XuH lUkJ1VHkRWvtgJbiBH1/4kSH/fEjaSkCzi5IyCXzehsd5gv3tWyh6JgVNMrQuFE5/KSc 3FLXKqvPXpTTeGdHinvnmTQAipIaa09jNFYtm3Rb8JdYEMFx+ZNkZeNmV3WRtGtlesIM 50uHGxHQtDYsBlsqh0ncGmsg2qw45sH3eQVzw9dm5HRwU9s2k4F1E0WcbJIDoznzAKLR NoeA== X-Gm-Message-State: AGi0PuZOm9BBocIpqDzvgczQCbbRFZTebj8xdMEJTdg186y1DhyjudJp hKhE7GjcCIhB9lWhePeOST4zQw== X-Google-Smtp-Source: APiQypK59SlRNgDfuD9YFLS4aLQhRUX3Ldl8rQlNrOStGkMPDChTtkn8OUSg2Je4M9QQr+hXrQ7w6A== X-Received: by 2002:a05:6830:1483:: with SMTP id s3mr9977208otq.176.1589140787760; Sun, 10 May 2020 12:59:47 -0700 (PDT) Received: from Ralphs-ZiffBook-Pro.local (ip72-204-153-233.no.no.cox.net. [72.204.153.233]) by smtp.gmail.com with ESMTPSA id q12sm2113660otn.57.2020.05.10.12.59.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 May 2020 12:59:47 -0700 (PDT) To: PHP internals Cc: David Rodrigues References: Message-ID: Date: Sun, 10 May 2020 14:59:46 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Proposal For Return-If / Early Return / Guard Clause Syntax From: ralph@ralphschindler.com (Ralph Schindler) On 5/10/20 1:56 PM, David Rodrigues wrote: > Suggestion: > > return if $x > 1; (to return "void") > return $y if ($x > 1 && $x < 5); > break if $x > 1; > break 2 if $x > 1; > throw new Exception if $x > 1; > 100% that will/should be a votable alternative option should this get to the voting phase. I have reasons for why I chose my initial path, but its worth mentioning I favor the optional value at the end maybe 65% to 35% where the value is after the initial keyword. Thanks for taking the time! -ralph schindler