stream_copy_to_stream() and fpasstru() do not update stream position
| Bug #48309 | stream_copy_to_stream() and fpasstru() do not update stream position | ||||
|---|---|---|---|---|---|
| Submitted: | 2009-05-17 14:48 UTC | Modified: | 2009-05-17 14:59 UTC | ||
| From: | lbarnaud@php.net | Assigned: | lbarnaud (profile) | ||
| Status: | Closed | Package: | Streams related | ||
| PHP Version: | 5 | OS: | |||
| Private report: | No | CVE-ID: | None | ||
[2009-05-17 14:48 UTC] lbarnaud@php.net
Description: ------------ stream_copy_to_stream() and fpasstru() do not update stream position of source stream, when source stream is a plain file. Reproduce code: --------------- <?php $fd = tmpfile(); fwrite($fd, b"test"); fseek($fd, 0, SEEK_SET); stream_copy_to_stream($fd, STDOUT, 2); echo "\n"; var_dump(stream_get_contents($fd)); ?> Expected result: ---------------- te string(2) "st" Actual result: -------------- te string(4) "test"
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2009-05-17 14:59 UTC] lbarnaud@php.net