xref: /PHP-8.3/ext/zlib/tests/gzgets_basic.phpt (revision 74859783)
1--TEST--
2Test function gzgets() by calling it with its expected arguments
3--EXTENSIONS--
4zlib
5--FILE--
6<?php
7
8// note that gzgets is an alias to fgets. parameter checking tests will be
9// the same as fgets
10
11$f = __DIR__."/004.txt.gz";
12$h = gzopen($f, 'r');
13$lengths = array(10, 14, 7, 99);
14foreach ($lengths as $length) {
15   var_dump(gzgets( $h, $length ) );
16}
17
18while (gzeof($h) === false) {
19   var_dump(gzgets($h));
20}
21gzclose($h);
22
23
24?>
25--EXPECT--
26string(9) "When you'"
27string(13) "re taught thr"
28string(6) "ough f"
29string(8) "eelings
30"
31string(26) "Destiny flying high above
32"
33string(38) "all I know is that you can realize it
34"
35string(18) "Destiny who cares
36"
37string(19) "as it turns around
38"
39string(39) "and I know that it descends down on me
40"
41