xref: /PHP-5.5/ext/zlib/tests/004.phpt (revision 45420bb6)
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
15echo "Done\n";
16?>
17--EXPECTF--
18Warning: gzfile() expects at least 1 parameter, 0 given in %s on line %d
19NULL
20
21Warning: gzfile(nonexistent_file_gzfile): failed to open stream: No such file or directory in %s on line %d
22bool(false)
23
24Warning: gzfile() expects at most 2 parameters, 3 given in %s on line %d
25NULL
26array(6) {
27  [0]=>
28  string(36) "When you're taught through feelings
29"
30  [1]=>
31  string(26) "Destiny flying high above
32"
33  [2]=>
34  string(38) "all I know is that you can realize it
35"
36  [3]=>
37  string(18) "Destiny who cares
38"
39  [4]=>
40  string(19) "as it turns around
41"
42  [5]=>
43  string(39) "and I know that it descends down on me
44"
45}
46array(6) {
47  [0]=>
48  string(36) "When you're taught through feelings
49"
50  [1]=>
51  string(26) "Destiny flying high above
52"
53  [2]=>
54  string(38) "all I know is that you can realize it
55"
56  [3]=>
57  string(18) "Destiny who cares
58"
59  [4]=>
60  string(19) "as it turns around
61"
62  [5]=>
63  string(39) "and I know that it descends down on me
64"
65}
66Done
67