|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-29 05:43 UTC] wez@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 21:00:01 2025 UTC |
Description: ------------ on slow pipes opened by popen fread return data to script before length bytes have been read or EOF (end of file) reached. may be it's not bug, but feature, but in this case, this feature must be documented. may be it's double #19783 Reproduce code: --------------- <?php ob_implicit_flush(1); echo "<b>".date("r")."</b><br>\n"; $fp=popen('for i in 1 2 3 4 5 6 7 8 9; do echo $i ; sleep 1 ; done',"r"); while(!feof($fp)) { $s=fread($fp,100000); echo "<b>".date("r")."</b><pre>$s</pre>\n"; } pclose($fp); ?> Expected result: ---------------- Tue, 29 Jul 2003 14:27:51 +0400 Tue, 29 Jul 2003 14:27:60 +0400 1 2 3 4 5 6 7 8 9 Actual result: -------------- Tue, 29 Jul 2003 14:26:01 +0400 Tue, 29 Jul 2003 14:26:01 +0400 1 Tue, 29 Jul 2003 14:26:02 +0400 2 Tue, 29 Jul 2003 14:26:03 +0400 3 Tue, 29 Jul 2003 14:26:04 +0400 4 Tue, 29 Jul 2003 14:26:05 +0400 5 Tue, 29 Jul 2003 14:26:06 +0400 6 Tue, 29 Jul 2003 14:26:07 +0400 7 Tue, 29 Jul 2003 14:26:08 +0400 8 Tue, 29 Jul 2003 14:26:09 +0400 9 Tue, 29 Jul 2003 14:26:10 +0400