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