Bug #13954: newline is stripped after the closing ?>

From: Date: Tue, 06 Nov 2001 15:37:46 +0000
Subject: Bug #13954: newline is stripped after the closing ?>
Groups: php.dev 
Request: Send a blank email to php-dev+get-69700@lists.php.net to get a copy of this message
From:             aln00@udcast.com
Operating system: linux 2.2.19
PHP version:      4.0.6
PHP Bug Type:     *General Issues
Bug description:  newline is stripped after the closing ?>

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 bug report at: http://bugs.php.net/?id=13954&edit=1



Thread (2 messages)

« previous php.dev (#69700) next »