1--TEST--
2Test deflate_init() error
3--SKIPIF--
4<?php
5if (!extension_loaded("zlib")) {
6    print "skip - ZLIB extension not loaded";
7}
8?>
9--FILE--
10<?php
11var_dump(deflate_init(42));
12var_dump(deflate_init(ZLIB_ENCODING_DEFLATE, ['level' => 42]));
13var_dump(deflate_init(ZLIB_ENCODING_DEFLATE, ['level' => -2]));
14var_dump(deflate_init(ZLIB_ENCODING_DEFLATE, ['memory' => 0]));
15var_dump(deflate_init(ZLIB_ENCODING_DEFLATE, ['memory' => 10]));
16?>
17--EXPECTF--
18Warning: deflate_init(): encoding mode must be ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d
19bool(false)
20
21Warning: deflate_init(): compression level (42) must be within -1..9 in %s on line %d
22bool(false)
23
24Warning: deflate_init(): compression level (-2) must be within -1..9 in %s on line %d
25bool(false)
26
27Warning: deflate_init(): compression memory level (0) must be within 1..9 in %s on line %d
28bool(false)
29
30Warning: deflate_init(): compression memory level (10) must be within 1..9 in %s on line %d
31bool(false)
32