mirror of
https://github.com/php/php-src.git
synced 2026-04-28 10:43:30 +02:00
MFH: Fixed bug #48309 (stream_copy_to_stream() and fpasstru() do not
update stream position of plain files)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
Bug #48309 (stream_copy_to_stream() and fpasstru() do not update stream position)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$tmp = tmpfile();
|
||||
fwrite($tmp, b'test');
|
||||
fseek($tmp, 0, SEEK_SET);
|
||||
|
||||
echo "-- stream_copy_to_stream() --\n";
|
||||
|
||||
fseek($tmp, 0, SEEK_SET);
|
||||
stream_copy_to_stream($tmp, STDOUT, 2);
|
||||
|
||||
echo "\n";
|
||||
var_dump(stream_get_contents($tmp));
|
||||
|
||||
echo "-- fpassthru() --\n";
|
||||
|
||||
fseek($tmp, 0, SEEK_SET);
|
||||
fpassthru($tmp);
|
||||
|
||||
echo "\n";
|
||||
var_dump(stream_get_contents($tmp));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
-- stream_copy_to_stream() --
|
||||
te
|
||||
string(2) "st"
|
||||
-- fpassthru() --
|
||||
test
|
||||
string(0) ""
|
||||
Reference in New Issue
Block a user