blob: cea2c5d6f22007f01edce162696dbdb557a81f4d (
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
|
--TEST--
gzinflate() and $length argument
--SKIPIF--
<?php if (!extension_loaded("zlib")) print "skip"; ?>
--FILE--
<?php
$original = 'aaaaaaaaaaaaaaa';
$packed=gzdeflate($original);
echo strlen($packed)." ".strlen($original)."\n";
$unpacked=gzinflate($packed, strlen($original));
if (strcmp($original,$unpacked)==0) echo "Strings are equal\n";
$unpacked=gzinflate($packed, strlen($original)*10);
if (strcmp($original,$unpacked)==0) echo "Strings are equal\n";
$unpacked=gzinflate($packed, 1);
if ($unpacked === false) echo "Failed (as expected)\n";
?>
--EXPECTF--
5 15
Strings are equal
Strings are equal
Warning: gzinflate(): insufficient memory in %s on line %d
Failed (as expected)
|