Bug #51954 [NEW]: [fputcsv] cast string to int
| From: | ph dot ausseil at gmail dot com | Date: | Mon, 31 May 2010 12:09:22 +0000 |
| Subject: | Bug #51954 [NEW]: [fputcsv] cast string to int | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-150956@lists.php.net to get a copy of this message | ||
From:
Operating system: windows
PHP version: Irrelevant
Package: Streams related
Bug Type: Bug
Bug description:[fputcsv] cast string to int
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"
--
Edit bug report at http://bugs.php.net/bug.php?id=51954&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51954&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51954&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=51954&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=51954&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51954&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51954&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51954&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51954&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51954&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51954&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51954&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51954&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51954&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51954&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51954&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51954&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51954&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51954&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51954&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51954&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51954&r=mysqlcfg