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
14include 'func.inc';
15if (version_compare(get_zlib_version(), "1.2.11") < 0) {
16    die("skip - at least zlib 1.2.11 required, got " . get_zlib_version());
17}
18?>
19--FILE--
20<?php
21echo "*** Testing gzencode() : variation ***\n";
22
23$data = "A small string to encode\n";
24
25echo "\n-- Testing with each encoding_mode  --\n";
26var_dump(bin2hex(gzencode($data, -1)));
27var_dump(bin2hex(gzencode($data, -1, FORCE_GZIP)));
28var_dump(bin2hex(gzencode($data, -1, FORCE_DEFLATE)));
29
30?>
31--EXPECT--
32*** Testing gzencode() : variation ***
33
34-- Testing with each encoding_mode  --
35string(90) "1f8b080000000000000a735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
36string(90) "1f8b080000000000000a735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
37string(66) "789c735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200735808cd"
38