|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-12-26 12:16 UTC] an0nym at narod dot ru
[2014-01-05 09:32 UTC] krakjoe@php.net
-Status: Open
+Status: Not a bug
[2014-01-05 09:32 UTC] krakjoe@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 06:00:01 2025 UTC |
Description: ------------ In non-blocking mode fgets should buffer data it read from stream until it meets eol or eof instead of returning anything it read. Test script: --------------- $ cat test1.php <?php fwrite(STDOUT, 'test1'); sleep(5); fwrite(STDOUT, "\n"); sleep(5); fwrite(STDOUT, "test2\n"); $ cat test2.php <?php stream_set_blocking(STDIN, false); do { $test = fgets(STDIN); if ($test) { var_dump($test); } } while (!feof(STDIN)); $ php55 test1.php | php55 test2.php Expected result: ---------------- string(6) "test1 " string(6) "test2 " Actual result: -------------- string(5) "test1" string(1) " " string(6) "test2 "