|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-02-22 05:21 UTC] rasmus@php.net
[2010-02-22 05:30 UTC] animatorboy at verizon dot net
[2010-02-22 05:37 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 21:00:01 2025 UTC |
Description: ------------ When I try to write to a file, whether the file exists or not the text sent is written twice. I tried using a counter to see if it was looping somewhere however it proved that the code was only run once. Reproduce code: --------------- $msg = 'TEST'; $fp = ('./logs/somefile.php'); file_put_contents($fp,$msg,FILE_APPEND); or $msg = 'TEST'; $fp = fopen('./logs/somefile.php','ab'); flock($fp, LOCK_EX); fwrite($fp, $msg); flock($fp, LOCK_UN); fclose($fp); Expected result: ---------------- TEST Actual result: -------------- TESTEST