php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28696 Line feed removed after a php closing tag
Submitted: 2004-06-08 14:50 UTC Modified: 2004-06-08 14:56 UTC
From: frederic dot poeydomenge at free dot fr Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.3.4 OS: Linux 2.6.6 Debian Sid
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: frederic dot poeydomenge at free dot fr
New email:
PHP Version: OS:

 

 [2004-06-08 14:50 UTC] frederic dot poeydomenge at free dot fr
Description:
------------
Line feed following a closing tag ?> is not actually reproduced in the output buffer.

When a space follows a closing tag, there is no problem, but when it is a line feed character, it seems not to be taken in consideration ?

Reproduce code:
---------------
<?php
$aaa='aaa';
$bbb='bbb';
$ccc='ccc';
?>

<pre>
line 1: aaa
line 2: bbb
line 3: ccc
</pre>

<pre>
line 1: <?php echo $aaa; ?>
line 2: <?php echo $bbb; ?>
line 3: <?php echo $ccc; ?>
</pre>

Expected result:
----------------
line 1: aaa
line 2: bbb
line 3: ccc

line 1: aaa
line 2: bbb
line 3: ccc

Actual result:
--------------
line 1: aaa
line 2: bbb
line 3: ccc

line 1: aaaline 2: bbbline 3: ccc

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-08 14:56 UTC] frederic dot poeydomenge at free dot fr
I've just found in the manual this little sentence :

"the closing tag for the block will include the immediately trailing newline if one is present."
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Sep 11 16:00:01 2025 UTC