summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/gzuncompress_basic1.phpt
blob: d82d7069e3a2d15f515e3918def3e2dd8a47e616 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--TEST--
Test gzuncompress() function : basic functionality
--SKIPIF--
<?php
if (!extension_loaded("zlib")) {
	print "skip - ZLIB extension not loaded";
}
?>
--FILE--
<?php
include(__DIR__ . '/data.inc');

echo "*** Testing gzuncompress() : basic functionality ***\n";


// Initialise all required variables
$compressed = gzcompress($data);

echo "\n-- Basic decompress --\n";
var_dump(strcmp($data, gzuncompress($compressed)));


$length = 3547;
echo "\n-- Calling gzuncompress() with max length of $length --\n";
echo "Result length is ".  strlen(gzuncompress($compressed, $length)) .  "\n";

?>
--EXPECT--
*** Testing gzuncompress() : basic functionality ***

-- Basic decompress --
int(0)

-- Calling gzuncompress() with max length of 3547 --
Result length is 3547