|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75515 "stream_copy_to_stream" doesn't stream anymore
Submitted: 2017-11-13 09:56 UTC Modified: 2017-11-15 14:36 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: nicolas dot grekas+php at gmail dot com Assigned: pollita (profile)
Status: Closed Package: Streams related
PHP Version: 7.2.0RC6 OS: Ubuntu
Private report: No CVE-ID: None
 [2017-11-13 09:56 UTC] nicolas dot grekas+php at gmail dot com
See test script.

This behavior change has been introduced in PHP7.2RC6, and can be fixed by the change on 710 of main/streams/streams.c:

-               if (!stream->wrapper || stream->wrapper->is_url) {
+               if (stream->wrapper != &php_plain_files_wrapper) {

Test script:
run on the shell:

php -r 'echo "ping"; stream_copy_to_stream(STDIN, STDOUT);' 

then type something to populate stdin, and hit "enter".
On "enter", the input should be copied to the STDOUT.
But on RC6, this doesn't happen until STDIN is closed.

Expected result:
see test script

Actual result:
see test script


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-11-13 10:00 UTC]
-Package: Scripting Engine problem +Package: Streams related
 [2017-11-13 10:11 UTC]
-Status: Open +Status: Verified
 [2017-11-14 19:00 UTC]
@remi+sara: Why master only? Because the cherry-pick will happen later?
 [2017-11-15 10:18 UTC]
-Status: Verified +Status: Assigned -Assigned To: +Assigned To: pollita
 [2017-11-15 10:18 UTC]
@Sara, this seems like it should be re-evaluated for 7.2 before GA
 [2017-11-15 14:36 UTC]
-Status: Assigned +Status: Closed
 [2017-11-15 14:36 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

Applied in PHP-7.2.0

BTW, more feedback welcome on this one
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 04:01:28 2024 UTC