Bug #67600 [NEW]: make print_r use PHP_EOL

From: Date: Wed, 09 Jul 2014 21:46:17 +0000
Subject: Bug #67600 [NEW]: make print_r use PHP_EOL
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186549@lists.php.net to get a copy of this message
From:             zelnaga at gmail dot com
Operating system: Windows 7
PHP version:      5.6.0RC2
Package:          Arrays related
Bug Type:         Bug
Bug description:make print_r use PHP_EOL

Description:
------------
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:

http://stackoverflow.com/a/24664153/569976

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

Expected result:
----------------
Array%0A%28%0A++++%5B0%5D+%3D%3E+2%0A%29%0A

Actual result:
--------------
Array%0D%0A%28%0D%0A++++%5B0%5D+%3D%3E+2%0D%0A%29%0D%0A

-- 
Edit bug report at https://bugs.php.net/bug.php?id=67600&edit=1
-- 



Thread (4 messages)

« previous php.bugs (#186549) next »