mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
- Use INI sections - Use CGI sections - Move data into a subfolder - Remove ZPP tests - Fix various bugs within tests - Simplify some Found while working on #18879
26 lines
657 B
PHP
26 lines
657 B
PHP
--TEST--
|
|
Test incremental deflate_init() context reuse
|
|
--EXTENSIONS--
|
|
zlib
|
|
--FILE--
|
|
<?php
|
|
$resource = deflate_init(ZLIB_ENCODING_DEFLATE);
|
|
foreach (range("a", "z") as $char) {
|
|
deflate_add($resource, $char);
|
|
}
|
|
deflate_add($resource, "", ZLIB_FINISH);
|
|
|
|
// Now reuse the existing resource after finishing the previous operations ...
|
|
$uncompressed = $compressed = "";
|
|
foreach (range("a", "z") as $char) {
|
|
$uncompressed .= $char;
|
|
$compressed .= deflate_add($resource, $char, ZLIB_NO_FLUSH);
|
|
}
|
|
$compressed .= deflate_add($resource, "", ZLIB_FINISH);
|
|
var_dump($uncompressed === zlib_decode($compressed));
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
bool(true)
|
|
===DONE===
|