xref: /PHP-7.3/ext/zlib/tests/gzrewind_basic.phpt (revision b746e698)
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 = dirname(__FILE__)."/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===DONE===
26--EXPECT--
27test rewind before doing anything
28bool(true)
29int(0)
30
31first 30 characters=When you're taught through fee
32int(30)
33int(0)
34first 10 characters=When you'r
35first 20 characters=When you're taught t
36===DONE===
37