Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:117852
Return-Path: <shinji.igarashi@gmail.com>
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 90583 invoked from network); 5 Jun 2022 06:39:05 -0000
Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5)
  by pb1.pair.com with SMTP; 5 Jun 2022 06:39:05 -0000
Received: from php-smtp4.php.net (localhost [127.0.0.1])
	by php-smtp4.php.net (Postfix) with ESMTP id 8E1FB1801FD
	for <internals@lists.php.net>; Sun,  5 Jun 2022 01:24:17 -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.3 required=5.0 tests=BAYES_50,
	FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,
	RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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: <shinji.igarashi@gmail.com>
Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42])
	(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 <internals@lists.php.net>; Sun,  5 Jun 2022 01:24:14 -0700 (PDT)
Received: by mail-ej1-f42.google.com with SMTP id bg6so3710758ejb.0
        for <internals@lists.php.net>; Sun, 05 Jun 2022 01:24:14 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20210112;
        h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
        bh=nxv6Rk7leBTr0ZcM1cFi/CGSYYVfyfFGoXp4DybGRiI=;
        b=2t3p9WRUcxAYzIrpJ1yh1di9gUVBtp971CX6O2M71fPCHo71eH/rnfnazX7LoIH4NS
         o4mOl8W9g5AZBQXeDNVG3GiK8J+kAIrlrjZGZ4bKSr4KyKEjrHGS54TQb1OdBGER+Ozq
         LlgnVkEdwRmFKR1wFpNKmAbdMtFRGNQ20lNWYUNgYzHXaGSnATFPmS0LY0CVZXT9NyL6
         CJ/vhuoPlXXmVFtSyDjjyuLViowAJqi7zWa14uIX1RECjTzcszUVLHAeNz+S5rr8474D
         M6S1Lyu4zeMWUwwn7TcF+4Q6dVEloFDCtBM7jHJrB39q7mAGeLt3hYDYE7OJFkJrKhZO
         /E6Q==
X-Gm-Message-State: AOAM5306IC1zpL8RcCglFDFRs8mBrqm/M83N7hU6KcBq8bzAVnRWduBm
	wPmH4qrfb/HWE2ehsH72MH6pR3CcrAaeIddd
X-Google-Smtp-Source: ABdhPJxUC6Db4cOadSHfSQkiOlrUY6xedBVB4g6syKiRZY9uoUdDCtJwMC1FPlYofpog2DZBunbSeQ==
X-Received: by 2002:a17:907:1385:b0:710:6269:62a2 with SMTP id vs5-20020a170907138500b00710626962a2mr6922106ejb.537.1654417452562;
        Sun, 05 Jun 2022 01:24:12 -0700 (PDT)
Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com. [209.85.128.54])
        by smtp.gmail.com with ESMTPSA id r18-20020aa7cfd2000000b0042dc8dd59c7sm6604653edy.51.2022.06.05.01.24.11
        for <internals@lists.php.net>
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Sun, 05 Jun 2022 01:24:12 -0700 (PDT)
Received: by mail-wm1-f54.google.com with SMTP id l126-20020a1c2584000000b0039c1a10507fso552135wml.1
        for <internals@lists.php.net>; Sun, 05 Jun 2022 01:24:11 -0700 (PDT)
X-Received: by 2002:a05:600c:4e16:b0:397:6d34:76a4 with SMTP id
 b22-20020a05600c4e1600b003976d3476a4mr17179568wmq.0.1654417451288; Sun, 05
 Jun 2022 01:24:11 -0700 (PDT)
MIME-Version: 1.0
Date: Sun, 5 Jun 2022 17:23:59 +0900
X-Gmail-Original-Message-ID: <CAH19jWht_1VBgZKWL8wfb5EL6oG8JQf1zxGN2nS7dswyVB9Pzg@mail.gmail.com>
Message-ID: <CAH19jWht_1VBgZKWL8wfb5EL6oG8JQf1zxGN2nS7dswyVB9Pzg@mail.gmail.com>
To: internals <internals@lists.php.net>
Content-Type: text/plain; charset="UTF-8"
Subject: Adding new closing tag =?> for keeping trailing newline
From: sji@sj-i.dev (shinji igarashi)

Hello everyone,

I'd like to propose adding a new closing tag `=?>` to the language.

PHP currently removes the newline character immediately following
the closing tag `?>`.

With the new closing tag `=?>`,  the code should look like this:

```
- <?= 1 =?>
- <?= 2 =?>
- <?= 3 =?>
```

and the results it produces would be:

```
- 1
- 2
- 3
```

instead of the following:

```
- 1- 2- 3
```

This addition requires only a one-line modification to the lexer and
doesn't break BC. The proposed patch is here.
https://github.com/php/php-src/pull/8708

Before writing an RFC, I would like to hear your input on whether
it's worth tackling.

Thanks!

--
Shinji Igarashi