xref: /PHP-8.0/ext/zlib/tests/gzrewind_basic.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');
13echo "test rewind before doing anything\n";
14var_dump(gzrewind($h));
15var_dump(gztell($h));
16echo "\nfirst 30 characters=".gzread($h, 30)."\n";
17var_dump(gztell($h));
18gzrewind($h);
19var_dump(gztell($h));
20echo "first 10 characters=".gzread($h, 10)."\n";
21gzrewind($h);
22echo "first 20 characters=".gzread($h, 20)."\n";
23gzclose($h);
24?>
25--EXPECT--
26test rewind before doing anything
27bool(true)
28int(0)
29
30first 30 characters=When you're taught through fee
31int(30)
32int(0)
33first 10 characters=When you'r
34first 20 characters=When you're taught t
35