#20556 [Opn->Bgs]: php blocks strip newlines from output
| From: | derick@php.net | Date: | Fri, 22 Nov 2002 11:00:29 +0000 |
| Subject: | #20556 [Opn->Bgs]: php blocks strip newlines from output | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-25547@lists.php.net to get a copy of this message | ||
ID: 20556
Updated by: derick@php.net
Reported By: php@3wheel.net
-Status: Open
+Status: Bogus
Bug Type: Output Control
Operating System: FreeBSD 4.2-REL
PHP Version: 4.2.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2002-11-21 20:15:52] php@3wheel.net
This problem never shows up when using PHP to output HTML since it
ignores newlines... but if you're outputting straight text it's a huge
hassle. Any block of php code placed at the end of a line (adjacent to
a newline character) will "eat" that newline character. Example:
********10<? ?>
********20
Give it a try, it outputs:
********10********20
No matter what is present in the php block this happens. If there is a
character directly following the block it will not get eaten:
********10<? ?>C
********20
Produces:
********10C
********20
This is a big annoyance for me, as I'm using PHP to generate text (as
well as html) emails using templates. I'm thinking the parser is just
running off the end of the line looking for another php block, but it
never bothers to put the newline back when it's done.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20556&edit=1