#43524 [NEW]: Carriage Return in implode() truncates output
| From: | kris at sledge-hammer dot net | Date: | Fri, 07 Dec 2007 00:58:06 +0000 |
| Subject: | #43524 [NEW]: Carriage Return in implode() truncates output | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-120440@lists.php.net to get a copy of this message | ||
From: kris at sledge-hammer dot net
Operating system: Mac OS X
PHP version: 5.2.5
PHP Bug Type: Arrays related
Bug description: Carriage Return in implode() truncates output
Description:
------------
Imploding an array on a Carriage Return (\r) produces unexpected result.
Reproduce code:
---------------
$TestArray[] = "Hrm...something is fishy here.";
$TestArray[] = "It seems that newlines work just fine.";
$TestArray[] = "Carriage Returns no so much";
echo "\nNewline:\n";
echo implode("\n",$TestArray); //works
echo "\nCarriage Return:\n";
echo implode("\r",$TestArray); //doesn't work
Expected result:
----------------
It should return
Newline:
Hrm...something is fishy here.
It seems that newlines work just fine.
Carriage Returns no so much
Carriage Return:
Hrm...something is fishy here.
It seems that newlines work just fine.
Carriage Returns no so much
Actual result:
--------------
It produces
Newline:
Hrm...something is fishy here.
It seems that newlines work just fine.
Carriage Returns no so much
Carriage Return:
Carriage Returns no so much just fine.
Notice that the CR result looks like buffer issue, returns mashup of two
array values.
--
Edit bug report at http://bugs.php.net/?id=43524&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43524&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43524&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43524&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43524&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43524&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=43524&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43524&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43524&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43524&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43524&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43524&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=43524&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=43524&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43524&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43524&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43524&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43524&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43524&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43524&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43524&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43524&r=mysqlcfg