Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110180 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75427 invoked from network); 16 May 2020 14:32:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 May 2020 14:32:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CDE481804E1 for ; Sat, 16 May 2020 06:10:25 -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-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) (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 ; Sat, 16 May 2020 06:10:25 -0700 (PDT) Received: by mail-ed1-f67.google.com with SMTP id b91so4508214edf.3 for ; Sat, 16 May 2020 06:10:25 -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=QzoUFaBknjEqW56fZaVlADjX/40mkXvhO7LaMDIjZQ4=; b=SKUxt9DR5V+F47q4Py22vTCEE0sFsARHHEZMQfXTxj2pcoDrS2NvlS4kqgNi9VMHEw AOVi/Qd5gy+FaHNLT1mPn8ouBVemODycBV27xdGb2o8PMgzXR1L8GikC8qf+nFeACHyT 9A3Q9h8/z6JZDlXm2DGus/h30lowxQUvBhoOtBodK62mGDXEd8tjLlW9lLn5OZ4kDaHf mdOoamEp71cUSUQVhBP5LZjaDwFv8NAQYIdrMQxUoBAusCn1ygFEDhFKy1OJgBYFSOEo K7qVRMiESuXAPTlJRBJ2bmwhmnr0Tj49J+mJK6oqcqU1Sge0y9Uh1eRtO1eqzppB4nUj J/sA== 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=QzoUFaBknjEqW56fZaVlADjX/40mkXvhO7LaMDIjZQ4=; b=Uphs8wat4Ln/rxIyqOXTuCDBj0YKNfBRkEYG2Ss+09FWJ3A+PDaZzEmDb9/TLWD0ZT Ex3Ppd/Ex131ePpXcqAxDMdF41sCJVCSKcu0J44r5g8KqAcfHBX7wldTreAU++xVwJhL JWXE1e9gPObP1N77cNNb8BtFixdBYNjoYWYDXVd3L9WA8xZdU06rZ825XJLdxK2/OWp3 rAtTkDB8FfWwzwWvxnh+OdQ7BmKENk9IfewTG8HsvWYlq02mNa7vci7ES82c43Go9cud Vw8SM+kYmD0YJuwDTsBJwZhyaaWqAgf0KW+PrACmrgZ2a3Xlo+Fms0oqARaVYovF2Up+ qclQ== X-Gm-Message-State: AOAM532hmfv2L5abhJCQ8MK1/m2I22L8sFBbmVjEv73YRT5X7Ym8+bSW xo0QaYn13GeUcqtsdvt1mMHzmkrWUx3AvfekCko= X-Google-Smtp-Source: ABdhPJwonD19QhocaG+acfxbTD0pDCgXISWB2mj6RnDXUxICkrljf1fjPdEXUn7jr8/Ljr97ldkcKSfpoAXQigiZk9I= X-Received: by 2002:aa7:d787:: with SMTP id s7mr6947750edq.104.1589634624094; Sat, 16 May 2020 06:10:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 16 May 2020 15:10:12 +0200 Message-ID: To: Pavel Patapau Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000178e9d05a5c3a7b5" Subject: Re: [PHP-DEV] [RFC] Guard statement From: george.banyard@gmail.com ("G. P. B.") --000000000000178e9d05a5c3a7b5 Content-Type: text/plain; charset="UTF-8" On Sat, 16 May 2020 at 11:14, Pavel Patapau wrote: > Hello everyone, > > I want to propose new syntax addition - guard statement, that executes > code only if expression equals false and must contain control-flow > changing code, and written a respective RFC: > > https://wiki.php.net/rfc/guard_statement > > > Implementation in progress. > > I started work before this proposal https://externals.io/message/110107 > and respected some moments in the RFC. > > > Thanks for consideration, > Pavel > This is a fat no from my side. I see no benefit instead of using a normal if construct. This guard syntax has more keystrokes, doesn't read like "normal" English, has massive BC implications. I don't see why this would encourage defensive programming as you still need to write code with this in mind. Moreover, we already have assertions [1] although they could be improved, I'd rather have this be the focus than introducing this guard proposal. Best regards George P. Banyard [1] https://www.php.net/manual/en/function.assert.php --000000000000178e9d05a5c3a7b5--