|  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: -
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:
Status: Open Package: Arrays related
PHP Version: 5.6.0RC2 OS: Windows 7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Apr 22 00:01:23 2021 UTC