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