Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110119 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 77478 invoked from network); 10 May 2020 22:57:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 10 May 2020 22:57:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1E5601804C2 for ; Sun, 10 May 2020 14:33:46 -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-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (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 14:33:44 -0700 (PDT) Received: by mail-oi1-f179.google.com with SMTP id 19so13483174oiy.8 for ; Sun, 10 May 2020 14:33:44 -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=ycZY6nMLcO6Wkyc9QyOqcP+tH3/U5M7GvqE/i7vBE/4=; b=PXYDs6AIRPnI9oa3lCIHjUeT6UgjCWMtEovokqZZwwO/uRsMLj1ItQ0o+YJdeCIDmR YMY/5OdMHR6jFh+ANCbOy+iLIBcKYyo/JryoZ3xZunTrf6UsZvrkBR7zoX/nDF9uFKPU 2bTyb2xRsMW0qqL0zrrwZ4tsqhW+p2XjSjseUJgBu2TJgz3iB8Nn7Q+gl2ainfGA+d/J Mj+bIraOxlVhszc/dmyYqvL9WmCG/yMDDSkY/al0EPf2q9kx3NQLT4yYEAJwB6DVHSC6 nsBrF4YO+6QySDD64DuDKEWs8Gld1x/8soHCEPRGMP12wT/9MuahqM20yIIWs8KMkLJx CVZQ== 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=ycZY6nMLcO6Wkyc9QyOqcP+tH3/U5M7GvqE/i7vBE/4=; b=Z0ouDfeXRkPr7au+/MWbrz7ueQRKH89XveRE8lbnyVyzL7nRUNX8NrvK5ksy3XO5aV NADaUq2tO/FEyrHwoH6QZUFkGOxwzKsOy+iG910QE6hR+CiA5JY41el/8AF8FjsRNFyN KzZM1P6FhKIxDtkpHA3PbkFntHpoMkreCLqQIOecDvO8KFAIsfxY5YysKAbX+ZdUgu3+ eiHY+FRHahj1BNbShKglS0favmphZeZeUA0epUkWqtWhQ/GT/lxwBDnG5WPoEdsEqSUM BKDqYNaIqsJ4kezZNcQOrLbFCQCthIPB90o+wYsRayHgtqEEjq9yobWx/p1cWbPDpwqp 2kAw== X-Gm-Message-State: AGi0PuZ60ECOwQDNOGaOdjJ/3jd9US8e7CWOnqLYajNYYJDD98Ljg2J0 g+mqcJndBrJvmYEjOVUJBTqo7qTQu32/NotwdkP4bA== X-Google-Smtp-Source: APiQypLCN6PbmDjf8YPFuTfk7hb67Jb18HbQyPbcTIxCoYWyvJ/rNYSHyyKijLiwcF59CqN54TmHR0DaDdoOdnI0DxU= X-Received: by 2002:aca:4ad6:: with SMTP id x205mr17785423oia.138.1589146423437; Sun, 10 May 2020 14:33:43 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 10 May 2020 18:33:32 -0300 Message-ID: To: Ralph Schindler Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000010aee705a551fc50" Subject: Re: [PHP-DEV] Proposal For Return-If / Early Return / Guard Clause Syntax From: david.proweb@gmail.com (David Rodrigues) --00000000000010aee705a551fc50 Content-Type: text/plain; charset="UTF-8" I just think that this way is more compatible witth the reading. "Return X if Y" seems better than "return (if) X: (then) Y". Too the ":" could conflicts with return type. Em dom, 10 de mai de 2020 16:59, Ralph Schindler escreveu: > > > 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 > --00000000000010aee705a551fc50--