1--TEST-- 2Test incremental inflate_init() context reuse 3--EXTENSIONS-- 4zlib 5--FILE-- 6<?php 7$resource = inflate_init(ZLIB_ENCODING_GZIP); 8 9$uncompressed = implode(range("a","z")); 10$compressed = gzencode($uncompressed); 11$inflated = ""; 12for ($i=0;$i<strlen($compressed);$i++) { 13 $inflated .= inflate_add($resource, $compressed[$i]); 14} 15$inflated .= inflate_add($resource, "", ZLIB_FINISH); 16assert($inflated === $uncompressed); 17 18// Now reuse the existing resource after finishing the previous operations ... 19$inflated = ""; 20for ($i=0;$i<strlen($compressed);$i++) { 21 $inflated .= inflate_add($resource, $compressed[$i]); 22} 23$inflated .= inflate_add($resource, "", ZLIB_FINISH); 24assert($inflated === $uncompressed); 25?> 26===DONE=== 27--EXPECT-- 28===DONE=== 29