1--TEST--
2Bug #48309 (stream_copy_to_stream() and fpasstru() do not update stream position)
3--FILE--
4<?php
5
6$tmp = tmpfile();
7fwrite($tmp, 'test');
8fseek($tmp, 0, SEEK_SET);
9
10echo "-- stream_copy_to_stream() --\n";
11
12fseek($tmp, 0, SEEK_SET);
13stream_copy_to_stream($tmp, STDOUT, 2);
14
15echo "\n";
16var_dump(stream_get_contents($tmp));
17
18echo "-- fpassthru() --\n";
19
20fseek($tmp, 0, SEEK_SET);
21fpassthru($tmp);
22
23echo "\n";
24var_dump(stream_get_contents($tmp));
25
26?>
27--EXPECT--
28-- stream_copy_to_stream() --
29te
30string(2) "st"
31-- fpassthru() --
32test
33string(0) ""
34