1--TEST--
2gzfile(), gzreadfile()
3--SKIPIF--
4<?php
5if (!extension_loaded("zlib")) print "skip"; ?>
6--FILE--
7<?php
8$original = <<<EOD
9blah blah blah blah blah blah blah
10blah blah blah blah blah blah blah
11blah blah blah blah blah blah blah
12blah blah blah blah blah blah blah
13blah blah blah blah blah blah blah
14blah blah blah blah blah blah blah
15blah blah blah blah blah blah blah
16blah blah blah blah blah blah blah
17blah blah blah blah blah blah blah
18blah blah blah blah blah blah blah
19blah blah blah blah blah blah blah
20blah blah blah blah blah blah blah
21blah blah blah blah blah blah blah
22blah blah blah blah blah blah blah
23blah blah blah blah blah blah blah
24blah blah blah blah blah blah blah
25
26EOD;
27
28$filename = tempnam(sys_get_temp_dir(), "phpt");
29
30$fp = gzopen($filename, "wb");
31gzwrite($fp, $original);
32var_dump(strlen($original));
33fclose($fp);
34
35readgzfile($filename);
36
37echo "\n";
38
39$lines = gzfile($filename);
40
41unlink($filename);
42
43foreach ($lines as $line) {
44    echo $line;
45}
46
47?>
48--EXPECT--
49int(560)
50blah blah blah blah blah blah blah
51blah blah blah blah blah blah blah
52blah blah blah blah blah blah blah
53blah blah blah blah blah blah blah
54blah blah blah blah blah blah blah
55blah blah blah blah blah blah blah
56blah blah blah blah blah blah blah
57blah blah blah blah blah blah blah
58blah blah blah blah blah blah blah
59blah blah blah blah blah blah blah
60blah blah blah blah blah blah blah
61blah blah blah blah blah blah blah
62blah blah blah blah blah blah blah
63blah blah blah blah blah blah blah
64blah blah blah blah blah blah blah
65blah blah blah blah blah blah blah
66
67blah blah blah blah blah blah blah
68blah blah blah blah blah blah blah
69blah blah blah blah blah blah blah
70blah blah blah blah blah blah blah
71blah blah blah blah blah blah blah
72blah blah blah blah blah blah blah
73blah blah blah blah blah blah blah
74blah blah blah blah blah blah blah
75blah blah blah blah blah blah blah
76blah blah blah blah blah blah blah
77blah blah blah blah blah blah blah
78blah blah blah blah blah blah blah
79blah blah blah blah blah blah blah
80blah blah blah blah blah blah blah
81blah blah blah blah blah blah blah
82blah blah blah blah blah blah blah
83