xref: /PHP-8.4/ext/zlib/tests/gzfile_basic.phpt (revision 74859783)
1--TEST--
2Test function gzfile() reading a gzip relative file
3--EXTENSIONS--
4zlib
5--FILE--
6<?php
7$plaintxt = <<<EOT
8hello world
9is a very common test
10for all languages
11EOT;
12$dirname = 'gzfile_temp';
13$filename = $dirname.'/gzfile_basic.txt.gz';
14mkdir($dirname);
15$h = gzopen($filename, 'w');
16gzwrite($h, $plaintxt);
17gzclose($h);
18
19
20var_dump(gzfile( $filename ) );
21
22unlink($filename);
23rmdir($dirname);
24?>
25--EXPECT--
26array(3) {
27  [0]=>
28  string(12) "hello world
29"
30  [1]=>
31  string(22) "is a very common test
32"
33  [2]=>
34  string(17) "for all languages"
35}
36