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