From:             nikhil dot gupta at in dot ibm dot com
Operating system: Linux, Windows
PHP version:      5CVS-2007-08-03 (CVS)
PHP Bug Type:     Filesystem function related
Bug description:  fputcsv() inserts a new line character at the end of string

Description:
------------
fputcsv() inserts a newline character at the end of string. This behaviour
is not seen in the documentation. This happens for both php5 and php6 on
windows as well as on RHEL.

Reproduce code:
---------------
<?php
$list = array ('aaa,bbb');
$fp = fopen("file.tmp", 'w');
var_dump(fputcsv($fp, $list));
var_dump( filesize("file.tmp") );
var_dump( file_get_contents("file.tmp") );
fclose($fp);
?> 


Expected result:
----------------
int(9)
int(9)
string(9) ""aaa,bbb""


Actual result:
--------------
int(10)
int(10)
string(10) ""aaa,bbb"
"


-- 
Edit bug report at http://bugs.php.net/?id=42202&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42202&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42202&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42202&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42202&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42202&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42202&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42202&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42202&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42202&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42202&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42202&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42202&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42202&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42202&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42202&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42202&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42202&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42202&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42202&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42202&r=mysqlcfg

Reply via email to