xref: /PHP-5.3/ext/zlib/tests/gztell_basic.phpt (revision 8f9ec423)
1--TEST--
2Test function gztell() by calling it with its expected arguments 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 = dirname(__FILE__)."/004.txt.gz";
12$h = gzopen($f, 'r');
13$intervals = array(7, 22, 54, 17, 27, 15, 1000);
14// tell should be 7, 29, 83, 100, 127, 142, 176 (176 is length of uncompressed file)
15
16var_dump(gztell($h));
17foreach ($intervals as $interval) {
18   gzread($h, $interval);
19   var_dump(gztell($h));
20}
21
22gzclose($h);
23?>
24===DONE===
25--EXPECT--
26int(0)
27int(7)
28int(29)
29int(83)
30int(100)
31int(127)
32int(142)
33int(176)
34===DONE===