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-- 18 19Warning: deflate_init(): encoding mode must be ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d 20bool(false) 21 22Warning: deflate_init(): compression level (42) must be within -1..9 in %s on line %d 23bool(false) 24 25Warning: deflate_init(): compression level (-2) must be within -1..9 in %s on line %d 26bool(false) 27 28Warning: deflate_init(): compression memory level (0) must be within 1..9 in %s on line %d 29bool(false) 30 31Warning: deflate_init(): compression memory level (10) must be within 1..9 in %s on line %d 32bool(false) 33