Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100437 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33236 invoked from network); 7 Sep 2017 10:29:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2017 10:29:42 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.176 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.223.176 mail-io0-f176.google.com Received: from [209.85.223.176] ([209.85.223.176:36824] helo=mail-io0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D8/1F-10715-49F11B95 for ; Thu, 07 Sep 2017 06:29:42 -0400 Received: by mail-io0-f176.google.com with SMTP id d16so3194729ioj.3 for ; Thu, 07 Sep 2017 03:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=grheGnj/1E/ycHnS3zD0Y+KmwEk5i9Kh1wnPnQJj/pc=; b=aslawztS/Esg3ggWdUVpgvSzb5WWSZVi07XBq6WeymSyC9w5S53EQnJehVldUpfoPR jzUay49HWt7esiRFRE/fQxEFoF4Aa+3TPy1iTl6xc19bD+Hcks7uamQn+UWI0D5pfaHN PckbZkqs8bm6bXpuRuCq0z2CH8KXmckZXacybiaOXfWbczKVfHWPBuwqnNm0hp7uA+ce MJF5fmJsbFugWMR8ObUKOrROIUQ9hyikchX+q+kXKNGjv/PqAhMVcCGtgAqDeP7pOJsd F5zOMmDqEUvvlAdzs3XT0iA1fwKCtRTxSDMuKD8kvGDnZQVZ7PQm97J+AXMYIcwh3tYm GrZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=grheGnj/1E/ycHnS3zD0Y+KmwEk5i9Kh1wnPnQJj/pc=; b=fVv5caxkty+c+M/jzNnaNDlTTI+j2qcZtSrhkkTSlzwUll+NZmYMZWE+COHOSgIvpE OHFSyTNAB6C+/iN66X+O0P+sH7qV7zzHMSwgiBNbbwvw3bAu7UGdXPe0ITCb16NQnPWU ugSAXNjPKrupaUU7y7xmglJXUr2RHiH6tTNGDjCjMfNLG2iB/kpW4rVbmeDdgT7Z1qof Hdogf78gDLdHPiAmZm/ABe/gHrbFa8zV5ppQvIYllotQewMtAhnOgoHe6sfLZfk+56Ov 2TFXWfbGIeCCZl91S5EX/deWgQQoORqJm/H5Tvj16fELSrSSFmPT0jSMQWdchKp9RCAD tl0Q== X-Gm-Message-State: AHPjjUjEnvZl4WdsZCpzcxWAW6lDZ1AnzMandF7aCR+wj4q2e2ful84+ 3GcojAAGmFfcHsJMAdbP80jCmaBrBw== X-Google-Smtp-Source: AOwi7QAwiE0zxBnXDXRP2vYYYU5x/nM0Pz+dRX/F3XWJ37BCfLlpLbSc8LN50CoQ6ZIixG8pU6fMdCGMGQIcA7MMXVk= X-Received: by 10.107.12.33 with SMTP id w33mr2382088ioi.194.1504780177963; Thu, 07 Sep 2017 03:29:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.13.3 with HTTP; Thu, 7 Sep 2017 03:29:37 -0700 (PDT) In-Reply-To: <6dd0d2d1-3a4b-5b42-8396-0a6456a97f11@tekwire.net> References: <8C.6B.10715.4A4A0B95@pb1.pair.com> <6dd0d2d1-3a4b-5b42-8396-0a6456a97f11@tekwire.net> Date: Thu, 7 Sep 2017 12:29:37 +0200 Message-ID: To: =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= Cc: Andrea Faulds , PHP internals Content-Type: multipart/alternative; boundary="001a113f9d06f9268d055896ef47" Subject: Re: [PHP-DEV] Consider only ignoring newlines for final ?> in a file From: nikita.ppv@gmail.com (Nikita Popov) --001a113f9d06f9268d055896ef47 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Sep 7, 2017 at 12:11 PM, Fran=C3=A7ois Laupretre wrote: > Hi Andrea, > > > Le 07/09/2017 =C3=A0 03:45, Andrea Faulds a =C3=A9crit : > >> Hi everyone, >> >> This is the tiniest of issues, but it's bugged me for a long time and >> makes the HTML produced by PHP code less readable than it out to be. >> Specifically, PHP ignores a newline immediately following a ?> tag. The >> reason for this is, from what I recall, to prevent issues where whitespa= ce >> at the end of a PHP file is echoed before headers can be sent. On UNIX i= n >> particular, all text files (should) end in a newline, so this is a >> reasonable and necessary feature. >> >> However, for ?> tags anywhere that aren't right at the end of the file, >> this is just a nuisance that makes for messy output. For example, HTML >> output that should look like: >> >> >> >> >> >> >>
foobar
>> >> May instead end up looking something like: >> >> >> >>
foo bar
>> >> Of course, HTML doesn't matter so much, it'll render the same to the >> end-user. However, for outputting e.g. plain text, newlines can be >> significant, and so you have to insert an ugly and surprising extra newl= ine >> following a tag. >> >> Would anyone object to me changing how PHP handles this so that only the >> final ?> tag consumes its following newline, and only at the end of the >> file? >> >> Thanks! >> > > +1 to create a PHP8 branch and change the behavior there. not in PHP7. > > Once again, some may think it's too early but, IMO, we should create such > a branch and encourage RFCs and changes targeting next major version to b= e > announced, discussed, implemented, and tested as soon as possible. This i= s > the only way to introduce BC breaks while minimizing their impact. We saw > this when talking about PHP7 features : when proposed too late, changes > introducing BC breaks generally must be rejected, whatever their value. > > Regards > > Fran=C3=A7ois > New branches cause a lot of additional overhead for core developers. Changes have to merged across all actively supported branches, commonly with NEWS file adjustments. Depending on where we are in the release cycle right now, we already have 3-4 active branches -- we don't need to add to that. I think it's fine to start targeting PHP 8 now with RFCs, but implementation work should be done outside of php-src. It is more cost effective for one person to rebase their code two years down the line than it is for everybody to do extra work every time they commit something. (Alternatively we would have to change our development model so that branches are not synchronized at all times.) Nikita --001a113f9d06f9268d055896ef47--