xref: /PHP-5.3/ext/zlib/tests/004.phpt (revision 8058f9fd)
1--TEST--
2gzfile() with various invalid params
3--SKIPIF--
4<?php if (!extension_loaded("zlib")) print "skip"; ?>
5--FILE--
6<?php
7
8var_dump(gzfile());
9var_dump(gzfile("nonexistent_file_gzfile",1));
10var_dump(gzfile(1,1,1));
11
12var_dump(gzfile(dirname(__FILE__)."/004.txt.gz"));
13var_dump(gzfile(dirname(__FILE__)."/004.txt.gz", 1));
14
15ini_set("magic_quotes_runtime", 1);
16var_dump(gzfile(dirname(__FILE__)."/004.txt.gz", -1));
17
18echo "Done\n";
19?>
20--EXPECTF--
21Warning: gzfile() expects at least 1 parameter, 0 given in %s on line %d
22NULL
23
24Warning: gzfile(nonexistent_file_gzfile): failed to open stream: No such file or directory in %s on line %d
25bool(false)
26
27Warning: gzfile() expects at most 2 parameters, 3 given in %s on line %d
28NULL
29array(6) {
30  [0]=>
31  string(36) "When you're taught through feelings
32"
33  [1]=>
34  string(26) "Destiny flying high above
35"
36  [2]=>
37  string(38) "all I know is that you can realize it
38"
39  [3]=>
40  string(18) "Destiny who cares
41"
42  [4]=>
43  string(19) "as it turns around
44"
45  [5]=>
46  string(39) "and I know that it descends down on me
47"
48}
49array(6) {
50  [0]=>
51  string(36) "When you're taught through feelings
52"
53  [1]=>
54  string(26) "Destiny flying high above
55"
56  [2]=>
57  string(38) "all I know is that you can realize it
58"
59  [3]=>
60  string(18) "Destiny who cares
61"
62  [4]=>
63  string(19) "as it turns around
64"
65  [5]=>
66  string(39) "and I know that it descends down on me
67"
68}
69array(6) {
70  [0]=>
71  string(37) "When you\'re taught through feelings
72"
73  [1]=>
74  string(26) "Destiny flying high above
75"
76  [2]=>
77  string(38) "all I know is that you can realize it
78"
79  [3]=>
80  string(18) "Destiny who cares
81"
82  [4]=>
83  string(19) "as it turns around
84"
85  [5]=>
86  string(39) "and I know that it descends down on me
87"
88}
89Done
90