php.net |  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
Votes:1
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
Description:
------------
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-11-13 10:00 UTC] [email protected]
-Package: Scripting Engine problem +Package: Streams related
 [2017-11-13 10:11 UTC] [email protected]
-Status: Open +Status: Verified
 [2017-11-14 19:00 UTC] [email protected]
@remi+sara: Why master only? Because the cherry-pick will happen later?
 [2017-11-15 10:18 UTC] [email protected]
-Status: Verified +Status: Assigned -Assigned To: +Assigned To: pollita
 [2017-11-15 10:18 UTC] [email protected]
@Sara, this seems like it should be re-evaluated for 7.2 before GA
 [2017-11-15 14:36 UTC] [email protected]
-Status: Assigned +Status: Closed
 [2017-11-15 14:36 UTC] [email protected]
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
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
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-2026 The PHP Group
All rights reserved.
Last updated: Tue Mar 17 11:00:01 2026 UTC