|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67600 make print_r use PHP_EOL
Submitted: 2014-07-09 21:46 UTC Modified: 2021-07-18 04:22 UTC
Avg. Score:3.6 ± 1.5
Reproduced:2 of 5 (40.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: zelnaga at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: Arrays related
PHP Version: 5.6.0RC2 OS: Windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
5 + 15 = ?
Subscribe to this entry?

 [2014-07-09 21:46 UTC] zelnaga at gmail dot com
print_r() seems to have \n hard-coded so even if your PHP_EOL is \r\n it'll still output everything with \n. The following stackoverflow post elaborates:

Test script:
$a = print_r(array(2), true);
echo urlencode($a);

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-07-06 14:24 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-07-06 14:24 UTC]
I wonder what would be the use case for needing CRLF for debug
 [2021-07-06 14:41 UTC]
Probably for Notepad, but even that supports LFs now...
 [2021-07-18 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 13 07:01:28 2024 UTC