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