|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-11-15 21:11 UTC] tvdijen at planet dot nl
[2008-07-13 16:08 UTC] jani@php.net
[2008-07-21 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 15:00:01 2025 UTC |
Description: ------------ If the input stream is filtered then fgets($stdin) does not return when newline is typed. Reproduce code: --------------- <?php class test_filter extends php_user_filter { public function filter($in, $out, &$consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { $bucket->data = strtoupper($bucket->data); $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); } return PSFS_PASS_ON; } } $stdin = fopen("php://stdin", "r"); stream_filter_register("test.23", "test_filter"); stream_filter_append($stdin, "test.23"); fgets($stdin); ?> Expected result: ---------------- Should return after newline. It does return if you comment the 2 stream... lines. Actual result: -------------- It hangs, probably waiting for more input.