1--TEST-- 2Test gzencode() function : variation - verify header contents with all encoding modes 3--SKIPIF-- 4<?php 5 6if( substr(PHP_OS, 0, 3) != "WIN" ) { 7 die("skip.. only for Windows"); 8} 9 10if (!extension_loaded("zlib")) { 11 print "skip - ZLIB extension not loaded"; 12} 13?> 14--FILE-- 15<?php 16/* Prototype : string gzencode ( string $data [, int $level [, int $encoding_mode ]] ) 17 * Description: Gzip-compress a string 18 * Source code: ext/zlib/zlib.c 19 * Alias to functions: 20 */ 21 22echo "*** Testing gzencode() : variation ***\n"; 23 24$data = "A small string to encode\n"; 25 26echo "\n-- Testing with each encoding_mode --\n"; 27var_dump(bin2hex(gzencode($data, -1))); 28var_dump(bin2hex(gzencode($data, -1, FORCE_GZIP))); 29var_dump(bin2hex(gzencode($data, -1, FORCE_DEFLATE))); 30 31?> 32===DONE=== 33--EXPECTF-- 34*** Testing gzencode() : variation *** 35 36-- Testing with each encoding_mode -- 37string(90) "1f8b080000000000000b735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000" 38string(90) "1f8b080000000000000b735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000" 39string(66) "789c735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200735808cd" 40===DONE=== 41