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.. Do not run on Windows"); 8} 9 10if (!extension_loaded("zlib")) { 11 print "skip - ZLIB extension not loaded"; 12} 13 14if (PHP_OS == "Darwin") { 15 print "skip - OS is encoded in headers, tested header is non Darwin"; 16} 17?> 18--FILE-- 19<?php 20echo "*** Testing gzencode() : variation ***\n"; 21 22$data = "A small string to encode\n"; 23 24echo "\n-- Testing with each encoding_mode --\n"; 25var_dump(bin2hex(gzencode($data, -1))); 26var_dump(bin2hex(gzencode($data, -1, FORCE_GZIP))); 27var_dump(bin2hex(gzencode($data, -1, FORCE_DEFLATE))); 28 29?> 30--EXPECT-- 31*** Testing gzencode() : variation *** 32 33-- Testing with each encoding_mode -- 34string(90) "1f8b0800000000000003735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000" 35string(90) "1f8b0800000000000003735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000" 36string(66) "789c735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200735808cd" 37