xref: /PHP-8.1/ext/zlib/tests/gzread_basic.phpt (revision 74859783)
1--TEST--
2Test function gzread() by calling it with its expected arguments
3--EXTENSIONS--
4zlib
5--FILE--
6<?php
7// note that gzread is an alias to fread. parameter checking tests will be
8// the same as fread
9
10$f = __DIR__."/004.txt.gz";
11$h = gzopen($f, 'r');
12$lengths = array(10, 14, 7, 99, 2000);
13
14foreach ($lengths as $length) {
15   var_dump(gzread( $h, $length ) );
16}
17gzclose($h);
18
19?>
20--EXPECT--
21string(10) "When you'r"
22string(14) "e taught throu"
23string(7) "gh feel"
24string(99) "ings
25Destiny flying high above
26all I know is that you can realize it
27Destiny who cares
28as it turns "
29string(46) "around
30and I know that it descends down on me
31"
32