1--TEST--
2Test incremental deflate_add() error functionality
3--SKIPIF--
4<?php
5if (!extension_loaded("zlib")) {
6    print "skip - ZLIB extension not loaded";
7}
8?>
9--FILE--
10<?php
11$badResource = fopen("php://memory", "r+");
12var_dump(deflate_add($badResource, "test"));
13
14$resource = deflate_init(ZLIB_ENCODING_DEFLATE);
15$badFlushType = 6789;
16var_dump(deflate_add($resource, "test", $badFlushType));
17?>
18--EXPECTF--
19Warning: deflate_add(): Invalid deflate resource in %s on line %d
20bool(false)
21
22Warning: deflate_add(): flush mode must be ZLIB_NO_FLUSH, ZLIB_PARTIAL_FLUSH, ZLIB_SYNC_FLUSH, ZLIB_FULL_FLUSH, ZLIB_BLOCK or ZLIB_FINISH in %s on line %d
23bool(false)
24