xref: /PHP-8.2/ext/zlib/tests/gztell_basic.phpt (revision 74859783)
1--TEST--
2Test function gztell() by calling it with its expected arguments when reading
3--EXTENSIONS--
4zlib
5--FILE--
6<?php
7$f = __DIR__."/004.txt.gz";
8$h = gzopen($f, 'r');
9$intervals = array(7, 22, 54, 17, 27, 15, 1000);
10// tell should be 7, 29, 83, 100, 127, 142, 176 (176 is length of uncompressed file)
11
12var_dump(gztell($h));
13foreach ($intervals as $interval) {
14   gzread($h, $interval);
15   var_dump(gztell($h));
16}
17
18gzclose($h);
19?>
20--EXPECT--
21int(0)
22int(7)
23int(29)
24int(83)
25int(100)
26int(127)
27int(142)
28int(176)
29