1--TEST--
2Test function gzseek() by calling it with SEEK_CUR when reading
3--EXTENSIONS--
4zlib
5--FILE--
6<?php
7$f = __DIR__."/004.txt.gz";
8$h = gzopen($f, 'r');
9
10echo "move to the 50th byte\n";
11var_dump(gzseek( $h, 50, SEEK_CUR ) );
12echo "tell=".gztell($h)."\n";
13//read the next 10
14var_dump(gzread($h, 10));
15
16echo "\nmove forward to the 94th byte\n";
17var_dump(gzseek( $h, 34, SEEK_CUR ) );
18echo "tell=".gztell($h)."\n";
19//read the next 10
20var_dump(gzread($h, 10));
21
22echo "\nmove backward to the 77th byte\n";
23var_dump(gzseek( $h, -27, SEEK_CUR ) );
24echo "tell=".gztell($h)."\n";
25//read the next 10
26var_dump(gzread($h, 10));
27gzclose($h);
28?>
29--EXPECT--
30move to the 50th byte
31int(0)
32tell=50
33string(10) " high abov"
34
35move forward to the 94th byte
36int(0)
37tell=94
38string(10) "ze it
39Dest"
40
41move backward to the 77th byte
42int(0)
43tell=77
44string(10) "hat you ca"
45