Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100445 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54468 invoked from network); 7 Sep 2017 14:21:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Sep 2017 14:21:09 -0000 X-Host-Fingerprint: 95.148.70.109 unknown Received: from [95.148.70.109] ([95.148.70.109:2681] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E8/92-10715-4D551B95 for ; Thu, 07 Sep 2017 10:21:09 -0400 Message-ID: To: internals@lists.php.net References: <8C.6B.10715.4A4A0B95@pb1.pair.com> <1E.30.10715.1EE31B95@pb1.pair.com> <5069eda5-21c5-9459-8631-0c701a98aba4@gmx.de> Date: Thu, 7 Sep 2017 15:21:05 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: <5069eda5-21c5-9459-8631-0c701a98aba4@gmx.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 95.148.70.109 Subject: Re: [PHP-DEV] Consider only ignoring newlines for final ?> in a file From: ajf@ajf.me (Andrea Faulds) Hi, Christoph M. Becker wrote: > On 07.09.2017 at 15:43, Andrea Faulds wrote: > >> Ah. See, it's actually that kind of code that is my problem. A practical >> example would be: >> >> >> >> >> >> >> >> >> >>
> > I start the "control flow lines" always on column 0 (similar to C > preprocessor instructions), what gives the desired output and is quite > readable: > > > > > > > > > >
This seems like a reasonable workaround, thank you for the idea. It reminds me of what PHP's source code does with preprocessor instructions: #ifndef FOO # define FOO #endif I might do this in future code. That said, I still think the ?> newline behaviour should be looked at, since this kind of workaround isn't universally applicable (and in any case isn't to everyone's tastes). In particular, if you want to generate plain text and need to insert a newline, having PHP throw them away and requiring you to add extra ones to compensate makes for uglier source code which is harder to reason about. Thanks! -- Andrea Faulds https://ajf.me/