Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117875 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 68659 invoked from network); 8 Jun 2022 12:29:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Jun 2022 12:29:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9C64A18037E for ; Wed, 8 Jun 2022 07:15:09 -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, T_SCC_BODY_TEXT_LINE 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-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 8 Jun 2022 07:15:06 -0700 (PDT) Received: by mail-pg1-f172.google.com with SMTP id e66so18983569pgc.8 for ; Wed, 08 Jun 2022 07:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FpbT9NJVUYNnm/JH8eg0u8ObGfhntsr2tZ7GoZkV5BM=; b=Id8ekc8nafrtTXbzgzUiDof28+C6EPlrwlSbrY/gYZYoZuIvv4Kv//clkZb7dWhW2O a6wWxQLiEqugbY6XEAZ4IBOmRvpUOsOgDRwAdsQFJ0q4ODcxVL2lXZzjiovNa6ywnoWX GP/3ApiQ1ErKKNX1zgVNW1hRJUQifE2DYnCk/bsPrXZiJIB1KSM+26NeW4ld7+Mmy/Py AFy7StIgSvaQmvg5Z7Fog9s8pkAueORQoTlL9ZTahJDOnplL8GCwUIkp8+vpJuDPJ+1E 3R596qqrCp1DFfWAdZicclk5BOuqSEtd5r/lhOYUeO9CCLaackdeogxelp4OwZdNlqPm vpPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FpbT9NJVUYNnm/JH8eg0u8ObGfhntsr2tZ7GoZkV5BM=; b=xo52kz1387ONSDOmNnVo5xli6qESYVmVGGUay3HQOXKUrQNvHZiwsCf4LQMOC3bAnX 6h9BQlBwMs9tgWenE1vYVmbE6ig9IW+zkPHJPd1WTv+bRCh7j1SFp8FNRARM4WAwYICF ZzXPgmwbrwG5DHKpFXJc632nLtcVpE39NjI/NcbS8BbJlgJZMQj5XIss/5ZPUPYzbZ9v c1nTiRCLdnA2V4Hf9Y2pOzIZxzPjjeYOTZe9GJ8nUHDCoS9ynrCdDCl9vvJvqOw1TVcx 6+vHphx6SfuDveC6mRS3swaou8a5y4nTFNauoY7i8uIevwz4WJwmQCSncZ0BpoBEkz3w 5uUQ== X-Gm-Message-State: AOAM531Sl+ehlwjWD9kb63xORtFMXoic4UrXbIXQA5sjnYb9plZXwOyS WAFoR75RkgQIf0OFJKoJL5pt8ibgL1PLiDnIa74= X-Google-Smtp-Source: ABdhPJwGAXUKz0E6cyux7hn1RKeM/y+t4mXTWUAImsxCQDWqf6H9UhU6cgzMb90ZXdG+Z70/f7FFSQx/rNNYOc9tJI0= X-Received: by 2002:a63:1e05:0:b0:3fd:9170:800d with SMTP id e5-20020a631e05000000b003fd9170800dmr16898732pge.586.1654697705079; Wed, 08 Jun 2022 07:15:05 -0700 (PDT) MIME-Version: 1.0 References: <563B99A1-88D9-4EA9-AAB3-982C3A6495C6@gmail.com> In-Reply-To: <563B99A1-88D9-4EA9-AAB3-982C3A6495C6@gmail.com> Date: Wed, 8 Jun 2022 10:14:52 -0400 Message-ID: To: Claude Pache Cc: Sara Golemon , Robert Landers , shinji igarashi , internals Content-Type: multipart/alternative; boundary="000000000000ec07d805e0f05455" Subject: Re: [PHP-DEV] Adding new closing tag =?> for keeping trailing newline From: chasepeeler@gmail.com (Chase Peeler) --000000000000ec07d805e0f05455 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 8, 2022 at 5:37 AM Claude Pache wrote: > > > > Le 8 juin 2022 =C3=A0 05:34, Sara Golemon a =C3=A9cri= t : > > > > > > > declare(ignore_newline_after_close_tag=3Dfalse); // defaults to true, i= .e > > existing behavior > > > > This would avoid any new syntax rules, but still provide the ability fo= r > > php-as-template-engine to behave in the user's preferred mode. > > > > No, because the user=E2=80=99s preferred mode is not a global one, it is = a local > one. You do not want to keep newlines in the following situation: > > ``` > * line 1 > > * line 2 > * line 3 > > * line 4 > ``` > > With a global switch, not only you have failed to solve the real problem > (doing the Right Thing with newlines), but also you have created another > one (looking at the top of the file in order to understand the code). You > have the worst of both world. > > Declare statements shouldn't have any impact outside of the file in which they appear. Declaring strict types doesn't force other classes that interact with the defined class to also use strict types. A declare to change how newlines after closing tags are handled within a single file forces anything that uses the classes/functions defined in that file to know that it handles them in a possibly different ways. I personally don't see a need for a new closing tag. I'm not usually swayed by the "it adds confusion to the language" and would be against removing such a tag if it existed and that was the reason for removing it. However, I do think it's something to consider when adding something new to the language. In this case, I don't think the positives outweigh the negatives, especially in light of the fact it's really easy to accomplish this without changes. > =E2=80=94Claude > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --=20 Chase Peeler chasepeeler@gmail.com --000000000000ec07d805e0f05455--