xref: /PHP-8.0/ext/zlib/tests/gzrewind_basic2.phpt (revision c5401854)
1--TEST--
2Test function gzrewind() 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
14// read to the end of the file
15echo "read to the end of the file, then rewind\n";
16gzread($h, 10000);
17var_dump(gzeof($h));
18var_dump(gztell($h));
19gzrewind($h);
20var_dump(gzeof($h));
21var_dump(gztell($h));
22echo "first 20 characters=".gzread($h,20)."\n";
23
24gzclose($h);
25?>
26--EXPECT--
27read to the end of the file, then rewind
28bool(true)
29int(176)
30bool(false)
31int(0)
32first 20 characters=When you're taught t
33