#42125 [Opn->Fbk]: fgetss reads an extra char from file created using file_put_content()
| From: | felipe@php.net | Date: | Sat, 09 Feb 2008 19:04:50 +0000 |
| Subject: | #42125 [Opn->Fbk]: fgetss reads an extra char from file created using file_put_content() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-122124@lists.php.net to get a copy of this message | ||
ID: 42125
Updated by: felipe@php.net
Reported By: kraghuba at in dot ibm dot com
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: Windows XP
PHP Version: 6CVS-2007-07-27 (snap)
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php6.0-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php6.0-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2007-07-27 11:54:16] kraghuba at in dot ibm dot com
Description:
------------
fgetss() read an extra char from a file which is created using
file_put_content() function.
This problem is noticed only on php6 with unicode ON.
Reproduce code:
---------------
<?php
$data = <<<EOT
<test>Testing fgetss() functions</test>
test
EOT;
$filename = "test.txt";
file_put_contents($filename, $data);
$fp = fopen($filename, "r");
var_dump( fgetss($fp) );
fclose($fp);
?>
Expected result:
----------------
int(44)
string(27) "Testing fgetss() functions
"
Actual result:
--------------
string(28) "Testing fgetss() functions
"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42125&edit=1