1--TEST--
2Test function stream_get_meta_data on a zlib stream
3--SKIPIF--
4<?php
5if (!extension_loaded("zlib")) {
6    print "skip - ZLIB extension not loaded";
7}
8?>
9--FILE--
10<?php
11echo "no wrapper\n";
12$f = __DIR__."/004.txt.gz";
13$h = gzopen($f,'r');
14var_dump(stream_get_meta_data($h));
15gzclose($h);
16echo "\nwith wrapper\n";
17$f = "compress.zlib://".__DIR__."/004.txt.gz";
18$h = fopen($f,'r');
19var_dump(stream_get_meta_data($h));
20gzclose($h);
21
22
23?>
24--EXPECTF--
25no wrapper
26array(7) {
27  ["timed_out"]=>
28  bool(false)
29  ["blocked"]=>
30  bool(true)
31  ["eof"]=>
32  bool(false)
33  ["stream_type"]=>
34  string(4) "ZLIB"
35  ["mode"]=>
36  string(1) "r"
37  ["unread_bytes"]=>
38  int(0)
39  ["seekable"]=>
40  bool(true)
41}
42
43with wrapper
44array(9) {
45  ["timed_out"]=>
46  bool(false)
47  ["blocked"]=>
48  bool(true)
49  ["eof"]=>
50  bool(false)
51  ["wrapper_type"]=>
52  string(4) "ZLIB"
53  ["stream_type"]=>
54  string(4) "ZLIB"
55  ["mode"]=>
56  string(1) "r"
57  ["unread_bytes"]=>
58  int(0)
59  ["seekable"]=>
60  bool(true)
61  ["uri"]=>
62  string(%d) "compress.zlib://%s/004.txt.gz"
63}
64