php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29528 Incorrect interpretation of carriage return symbol (\n)
Submitted: 2004-08-05 10:03 UTC Modified: 2004-08-05 10:09 UTC
From: neon at artem-catv dot ru Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.3.8 OS: Redhat Linux 9.0
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: neon at artem-catv dot ru
New email:
PHP Version: OS:

 

 [2004-08-05 10:03 UTC] neon at artem-catv dot ru
Description:
------------
If carriage return (\n) symbol placed between single commas PHP will output it as is. If it placed between double commas all be ok.


Reproduce code:
---------------
<?php

echo '\nTest\n'; /* outouts \nTest\n */
echo "\nTest\n"; /* outouts 
Test */

// or

$var1 = 'Enother\nTest';
$var2 = "Enother\nTest";
echo $var1; /* outputs Enother\nTest*/
echo $var2; /* outputs Enother
Test*/

?>

Expected result:
----------------
Test

Test
Enother
Test
Enother
Test

Actual result:
--------------
\nTest\n
Test
Enother\nTestEnother
Test

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-05 10:07 UTC] tony2001@php.net
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


 [2004-08-05 10:09 UTC] derick@php.net
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


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 11:01:34 2025 UTC