|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-01-06 05:18 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 16:00:02 2025 UTC |
Description: ------------ Do you this think fflush() realy works? plese see following code if you answer it's not a bug, please give me a example how to use fflush() correctly. Reproduce code: --------------- ----before fflush---- <?php $fp = fopen("1.txt", "w"); while(1) { fwrite($fp, "a"); sleep(1); } ?> ----after fflush---- <?php $fp1 = fopen("1.txt", "w"); $fp2 = fopen("2.txt", "w"); while(1) { fwrite($fp1, "a"); fflush($fp2); sleep(1); } ?> Expected result: ---------------- ---before fflush--- no contents in file "1.txt" until it's buffer is full ---after fflush--- "a a a a....." in file "2.txt" immediately Actual result: -------------- ---before fflush--- "a a a a....." in file "1.txt" immediately ---after fflush--- empty in file "2.txt"