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