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 = dirname(__FILE__)."/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://".dirname(__FILE__)."/004.txt.gz";
18$h = fopen($f,'r');
19var_dump(stream_get_meta_data($h));
20gzclose($h);
21
22
23?>
24===DONE===
25--EXPECTF--
26no wrapper
27array(7) {
28  ["stream_type"]=>
29  string(4) "ZLIB"
30  ["mode"]=>
31  string(1) "r"
32  ["unread_bytes"]=>
33  int(0)
34  ["seekable"]=>
35  bool(true)
36  ["timed_out"]=>
37  bool(false)
38  ["blocked"]=>
39  bool(true)
40  ["eof"]=>
41  bool(false)
42}
43
44with wrapper
45array(9) {
46  ["wrapper_type"]=>
47  string(4) "ZLIB"
48  ["stream_type"]=>
49  string(4) "ZLIB"
50  ["mode"]=>
51  string(1) "r"
52  ["unread_bytes"]=>
53  int(0)
54  ["seekable"]=>
55  bool(true)
56  ["uri"]=>
57  string(%d) "compress.zlib://%s/004.txt.gz"
58  ["timed_out"]=>
59  bool(false)
60  ["blocked"]=>
61  bool(true)
62  ["eof"]=>
63  bool(false)
64}
65===DONE===