php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51954 [fputcsv] cast string to int
Submitted: 2010-05-31 14:09 UTC Modified: 2010-08-09 01:11 UTC
From: ph dot ausseil at gmail dot com Assigned: felipe (profile)
Status: Closed Package: Streams related
PHP Version: Irrelevant OS: windows
Private report: No CVE-ID: None
 [2010-05-31 14:09 UTC] ph dot ausseil at gmail dot com
Description:
------------
numeric string begining by a zero are casted to int.

for example "0123456" will be output "123456" in the stream.

Test script:
---------------
       $fp = fopen("php://memory", 'wrb+');
       fputcsv($fp, array('0123456'), ';');
       rewind($fp);
       $stream =  stream_get_contents($fp);
       fclose($fp);
       echo $stream;

Expected result:
----------------
Output : "0123456;\n"

Actual result:
--------------
"123456;\n"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-31 15:00 UTC] mike@php.net
-Status: Open +Status: Feedback
 [2010-05-31 15:00 UTC] mike@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

works fine here.
 [2010-08-09 01:11 UTC] felipe@php.net
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: felipe
 [2010-08-09 01:11 UTC] felipe@php.net
I got "0123456" on 5.3.3. Closed.

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 06:01:31 2024 UTC