#23014 [Opn->Fbk]: Wrong output with funtion fwrite(), fputs()
| From: | sniper@php.net | Date: | Wed, 02 Apr 2003 16:59:51 +0000 |
| Subject: | #23014 [Opn->Fbk]: Wrong output with funtion fwrite(), fputs() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-37009@lists.php.net to get a copy of this message | ||
ID: 23014
Updated by: sniper@php.net
Reported By: c dot ferrari at gmx dot net
-Status: Open
+Status: Feedback
Bug Type: *General Issues
Operating System: Windows XP
PHP Version: 4.3.2RC1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2003-04-02 04:35:28] c dot ferrari at gmx dot net
Since PHP version 4.3.1 an also in version 4.3.2RC1 I have found some
problems with the function fputs() fwrite().
If you write only one character the functinon write two!!
Example 1:
<?php
$fp=fopen("test.txt","w+");
fputs($fp, "*");
fclose($fp);
?>
Result:
With a Hexeditor you can see 2A 0A.
Example 2:
<?php
$fp=fopen("test.txt","w+");
fputs($fp, "**");
fclose($fp);
?>
Result:
With a Hexeditor you can see the correct result 2A 2A.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23014&edit=1