summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/bug73944.phpt
blob: b23a9bafd3e9f8d6c4ea3b530025a5d34bb9460c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--TEST--
Bug #73944: Dictionary option of intflate_init() does not work
--SKIPIF--
<?php if(!extension_loaded('zlib')) die('skip zlib extension not loaded'); ?>
--FILE--
<?php

$in = inflate_init(ZLIB_ENCODING_RAW, array('dictionary' => str_repeat("\00", 32768)));
$a = inflate_add($in, file_get_contents(__DIR__.'/bug73944_fixture_1.data'));
echo '1 block: '.strlen($a).PHP_EOL;

$in = inflate_init(ZLIB_ENCODING_RAW, array('dictionary' => $a));
$b = inflate_add($in, file_get_contents(__DIR__.'/bug73944_fixture_2.data'));
echo '2 block: '.($b === false ? 'failed' : strlen($b)).PHP_EOL;

?>
--EXPECT--
1 block: 32768
2 block: 32768