1--TEST--
2Test gzuncompress() function : error conditions
3--SKIPIF--
4<?php
5if (!extension_loaded("zlib")) {
6    print "skip - ZLIB extension not loaded";
7}
8?>
9--FILE--
10<?php
11echo "*** Testing gzuncompress() : error conditions ***\n";
12
13echo "\n-- Testing with a buffer that is too small --\n";
14$data = 'string_val';
15$short_len = strlen($data) - 1;
16$compressed = gzcompress($data);
17
18var_dump(gzuncompress($compressed, $short_len));
19
20echo "\n-- Testing with incorrect arguments --\n";
21var_dump(gzuncompress(123));
22
23?>
24--EXPECTF--
25*** Testing gzuncompress() : error conditions ***
26
27-- Testing with a buffer that is too small --
28
29Warning: gzuncompress(): insufficient memory in %s on line %d
30bool(false)
31
32-- Testing with incorrect arguments --
33
34Warning: gzuncompress(): data error in %s on line %d
35bool(false)
36