1--TEST-- 2Test gzuncompress() function : basic functionality 3--SKIPIF-- 4<?php 5if (!extension_loaded("zlib")) { 6 print "skip - ZLIB extension not loaded"; 7} 8?> 9--FILE-- 10<?php 11/* Prototype : string gzuncompress(string data [, int length]) 12 * Description: Unzip a gzip-compressed string 13 * Source code: ext/zlib/zlib.c 14 * Alias to functions: 15 */ 16 17include(dirname(__FILE__) . '/data.inc'); 18 19echo "*** Testing gzuncompress() : basic functionality ***\n"; 20 21 22// Initialise all required variables 23$compressed = gzcompress($data); 24 25echo "\n-- Basic decompress --\n"; 26var_dump(strcmp($data, gzuncompress($compressed))); 27 28 29$length = 3547; 30echo "\n-- Calling gzuncompress() with max length of $length --\n"; 31echo "Result length is ". strlen(gzuncompress($compressed, $length)) . "\n"; 32 33?> 34===DONE=== 35--EXPECT-- 36*** Testing gzuncompress() : basic functionality *** 37 38-- Basic decompress -- 39int(0) 40 41-- Calling gzuncompress() with max length of 3547 -- 42Result length is 3547 43===DONE===