Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115238 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 32365 invoked from network); 30 Jun 2021 12:09:39 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 Jun 2021 12:09:39 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BAC971804DB for ; Wed, 30 Jun 2021 05:29:53 -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_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (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 ; Wed, 30 Jun 2021 05:29:53 -0700 (PDT) Received: by mail-ej1-f41.google.com with SMTP id gt10so2542734ejc.5 for ; Wed, 30 Jun 2021 05:29: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=Xocf6tIEn52mO/Gr5CFcDo1qMrMbM99BE1GmBMja4G8=; b=KdK0q0UY1l8PRSCGBivL4+SFHxmWoQlm2MV6NBcVYmJhGASJXA7pBBL998HcNwB7Lp HWkKRQ/SQHfqStTb5uDEsmN/7EZdGx62k/mNgAIqrjvX0NfyHl5WoO+kiP6WiMZjAW3r gZSSzYciGpqfIMDDcxmTIkYkNcnH9gGTiCmZJybpsOwgTMjFXkQJ1bbDCxIp7f162ql+ Gzih4XXbSdS5EjiYC9LxJJRNJvKhmj7NyXGpYgb6EbZsIjpSRCyYGkS49w8oL1PhxwB4 upJDbr+lWnFCYpkJ0BZdSvjlO3lV66V4UaNlaBjo2iGJKsqyo5L9uZN6QUoNWplCHJJP 658A== 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=Xocf6tIEn52mO/Gr5CFcDo1qMrMbM99BE1GmBMja4G8=; b=e1vwkTNSBIWDhXXmvNnMSuKLRqUtVeVR+uBqX/t91Ai4vdpalR4NgSEesYaw6Zbnib gLwTZAaEBUDRz6wEgkjtnWigBlI0oofF2HxD6EG2bivc3ADhgGIDIPSSuKVPXj4mJf3T 6vdnaWH2Lwc8G9mDXPV52D1wcCV2x+8PPugrqQR6TgZVbMMOWL+uwdp2FWZ6nXfnY0+W lCiIIn8mEL3vUX1DaeuMcGK6/TLFXobyPEKlttBxwpJWFvEpy6Osm4UB2oOebJai6dfO EkMiHftsFzM6Hn936gTupldbrJ4ffxqzJXT3MlF2cbBdx9DwzWFBga9QswHpAzJowwvS tZFA== X-Gm-Message-State: AOAM530bVSoXEjhKTyNhnRoWB86feihIGffJYpfv9a4nzZYRCjRwUqdv zM5JSohVHab2vqYZ0hrjSzZ2nxCPvo26SosWwDNC4GkXOCk= X-Google-Smtp-Source: ABdhPJyYWSI85CUHnSUbKkJfmpOH2W8DhAj6fdMcGTVW06sQ9DbZ1X1SacnvrzyzI5exzVJ4nzov1ZaOnaCuRRxcdvo= X-Received: by 2002:a17:906:841:: with SMTP id f1mr33799637ejd.308.1625056191906; Wed, 30 Jun 2021 05:29:51 -0700 (PDT) MIME-Version: 1.0 References: <17a588d53cc.f512f451993137.1114693900572862097@manuelcanga.dev> In-Reply-To: <17a588d53cc.f512f451993137.1114693900572862097@manuelcanga.dev> Date: Wed, 30 Jun 2021 14:29:40 +0200 Message-ID: To: Manuel Canga Cc: Internals Content-Type: multipart/alternative; boundary="0000000000000f064705c5fae160" Subject: Re: [PHP-DEV] [RFC] Alternative syntax for Nowdoc. From: george.banyard@gmail.com ("G. P. B.") --0000000000000f064705c5fae160 Content-Type: text/plain; charset="UTF-8" On Tue, 29 Jun 2021 at 18:15, Manuel Canga wrote: > Hi, folks, here again with a new purpose: ``` as alternative to Nowdoc > syntax. > > Currently, Nowdoc syntax is very "verbose": > > $string =<<<'CODE' >
>

Link: '%s'

>

> CODE; > > Why doesn't something like this?: > > $string =``` >
>

Link: '%s'

>

> ```; > > even as well: > > $string =```

Link: '%s'

```; > > > I see a caveat: this is very similar to `eval` syntax. However, this > syntax is more similar to Markdown syntax. > > What do you think ? > > Regards > Manuel Canga > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > I'm going to be harsh, but this proposal is utterly useless and harmful. As already stated by other people this is just the same as single quotes, and we frankly don't need yet another way of writing strings. This doesn't even try to solve the issue with string interpolation that JS does with backticks, which is an area in PHP which is quite a mess. Now onto why this proposal is harmful: This reuses syntax which has *very* different semantics (i.e. shell execution) for something different, moreso that the shell execution operator in PHP is valid markdown to go into the same literal parsing mode as what the triple backtick do, just inline. Even if we deprecated the shell operator (RFC which got shutdown already) I don't think it would be reasonable to reintroduce it without one full major release cycle where it didn't have any effect/is a parse error. This is also harmful for MarkDown because the whole point of the triple backtick which kicks you into a literal parsing mode, is so that you do not need to escape anything within this block, so your suggestion to "just escape" goes against the very point of this syntax in MarkDown, which was probably chosen because it did not conflict with any programming language whatsoever making it safe for this usage. Ignoring the fact that this proposal is way past the cutoff date to be able to make it into PHP 8.1 due to how the RFC process works, it seems that this feature just came into your mind and you decided to send it onto the list without considering its ramifications. Userland contribution and opinions on new features (or other internal discussion) is valuable but oughts to consider all the ramifications, good and bad, and how it affects the language as a whole. I say this because I didn't do this when I started contributing on this list and it made for less than stellar discussions. I would also recommend to any reader of this list who wants to propose a new feature to do this at the start of a new release around September, compared to moments before feature freeze where there are already a lot of proposals flying around from many old-time core contributors. The other benefit of doing this earlier than later is that you might even be able to get someone to hand hold you to create a patch for the feature. All this to say, this is a massive -1 from my end on this proposal. Best regards, George P. Banyard --0000000000000f064705c5fae160--