php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #43727 An addition to fwrite
Submitted: 2008-01-02 08:38 UTC Modified: 2008-04-18 06:30 UTC
From: rc at opelgt dot org Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rc at opelgt dot org
New email:
PHP Version: OS:

 

 [2008-01-02 08:38 UTC] rc at opelgt dot org
Description:
------------
It would be nice to mention that fwrite - here after fopen('w') - moves 
the pointer. So two times writing results in appending what is written, 
not replacing.

Reproduce code:
---------------
<?php
$datei = 'test.txt';
$dh = fopen($datei,'w');
flock($dh,LOCK_EX);
fwrite($dh,'1');
fwrite($dh,'23');
fclose($dh);
?>

Expected result:
----------------
Content of test.txt:

23

Actual result:
--------------
Content of test.txt:

123

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-18 06:30 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 05:00:01 2026 UTC