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