Bug #13954 Updated: newline is stripped after the closing ?>
ID: 13954
Updated by: jeroen
Reported By: aln00@udcast.com
Old Status: Open
Status: Bogus
Bug Type: *General Issues
Operating System: linux 2.2.19
PHP Version: 4.0.6
New Comment:
This is documented behaviour, and with a reason (to allow better formatting of php code without
ruining the layout of the output)
RTFM: http://uk.php.net/manual/en/language.basic-syntax.php#language.basic-syntax.phpmode
(admittingly, it's just a very small sentence...)
Previous Comments:
------------------------------------------------------------------------
[2001-11-06 10:37:46] aln00@udcast.com
Hello,
I'm using php as a powerful generic macro processor for ascii files, which contains some php
code. Everything is OK, except a very annoying problem when the php code generates nothing. For
example:
--------- FILE 1 ---------
var0 = "a constant string"
var1 = <?= $hh1 ?>
var2 = <?= $hh2 ?>
var3 = "another constant string"
---------------------------
with $hh1 and $hh2 empty will generate:
---------------------------
var0 = "a constant string"
var1 = var2 = var3 = "another constant string"
---------------------------
instead of :
---------------------------
var0 = "a constant string"
var1 =
var2 =
var3 = "another constant string"
---------------------------
NB: If I put a space after the ?>, the newline is not stripped.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13954&edit=1
Thread (2 messages)