1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
--TEST--
gzencode() and invalid params
--SKIPIF--
<?php if (!extension_loaded("zlib")) print "skip"; ?>
--FILE--
<?php
var_dump(gzencode());
var_dump(gzencode(1,1,1,1));
var_dump(gzencode("", -10));
var_dump(gzencode("", 100));
var_dump(gzencode("", 1, 100));
var_dump(gzencode("", -1, ZLIB_ENCODING_GZIP));
var_dump(gzencode("", 9, ZLIB_ENCODING_DEFLATE));
$string = "Light of my sun
Light in this temple
Light in my truth
Lies in the darkness";
var_dump(gzencode($string, 9, 3));
var_dump(gzencode($string, -1, ZLIB_ENCODING_GZIP));
var_dump(gzencode($string, 9, ZLIB_ENCODING_DEFLATE));
echo "Done\n";
?>
--EXPECTF--
Warning: gzencode() expects at least 1 parameter, 0 given in %s on line %d
NULL
Warning: gzencode() expects at most 3 parameters, 4 given in %s on line %d
NULL
Warning: gzencode(): compression level (-10) must be within -1..9 in %s on line %d
bool(false)
Warning: gzencode(): compression level (100) must be within -1..9 in %s on line %d
bool(false)
Warning: gzencode(): encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d
bool(false)
string(%d) "%s"
string(%d) "%s"
Warning: gzencode(): encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d
bool(false)
string(%d) "%s"
string(%d) "%s"
Done
|