ÿØÿà JFIF ÿÛ „ ( %!1!%*+...983,7(-.-
File manager
File manager - Edit - /opt/alt/tests/alt-php83-pecl-brotli_0.18.3-2.el8/tests/dictionary_incremental.phpt
Back
--TEST-- use dictionary: incremental --SKIPIF-- <?php if (BROTLI_DICTIONARY_SUPPORT === false) die('skip dictionary not supported'); ?> --FILE-- <?php include(dirname(__FILE__) . '/data.inc'); $dictionary = file_get_contents(dirname(__FILE__) . '/data.dict'); $modeTypes = [ 'BROTLI_PROCESS' => BROTLI_PROCESS, 'BROTLI_FLUSH' => BROTLI_FLUSH, ]; foreach ($modeTypes as $modeTypeKey => $modeType) { $compressed = ''; $context = brotli_compress_init(BROTLI_COMPRESS_LEVEL_DEFAULT, BROTLI_GENERIC, $dictionary); foreach (str_split($data, 6) as $var) { $compressed .= brotli_compress_add($context, $var, $modeType); } $compressed .= brotli_compress_add($context, '', BROTLI_FINISH); if ($data === brotli_uncompress($compressed, $dictionary)) { echo "OK: {$modeTypeKey}\n"; } else { echo "ERROR: {$modeTypeKey}\n"; } $out = ''; $context = brotli_uncompress_init($dictionary); foreach (str_split($compressed, 6) as $var) { $out .= brotli_uncompress_add($context, $var, $modeType); } $out .= brotli_uncompress_add($context, '', BROTLI_FINISH); if ($data === $out) { echo "Ok: {$modeTypeKey}\n"; } else { echo "Error: {$modeTypeKey}\n"; } } ?> ===DONE=== --EXPECT-- OK: BROTLI_PROCESS Ok: BROTLI_PROCESS OK: BROTLI_FLUSH Ok: BROTLI_FLUSH ===DONE===
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.57 |
proxy
|
phpinfo
|
Settings