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