summaryrefslogtreecommitdiff
path: root/ext/standard/tests/streams/bug48309.phpt
blob: 300926be513f069c3f77068b70f38891230a064a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--TEST--
Bug #48309 (stream_copy_to_stream() and fpasstru() do not update stream position)
--FILE--
<?php

$tmp = tmpfile();
fwrite($tmp, '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));

?>
--EXPECT--
-- stream_copy_to_stream() --
te
string(2) "st"
-- fpassthru() --
test
string(0) ""