xref: /PHP-8.0/ext/zlib/tests/gztell_basic.phpt (revision c5401854)
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 = __DIR__."/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--EXPECT--
25int(0)
26int(7)
27int(29)
28int(83)
29int(100)
30int(127)
31int(142)
32int(176)
33