1--TEST--
2Test gzencode() function : variation
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
22if(!function_exists("gzdecode")) {
23	function gzdecode($data)
24	{
25	   return gzinflate(substr($data,10,-8));
26	}
27}
28
29
30include(dirname(__FILE__) . '/data.inc');
31
32echo "*** Testing gzencode() : variation ***\n";
33
34echo "\n-- Testing multiple compression --\n";
35$output = gzencode(gzencode($data));
36
37$back = gzdecode(gzdecode($output));
38var_dump($data === $back);
39?>
40===Done===
41--EXPECT--
42*** Testing gzencode() : variation ***
43
44-- Testing multiple compression --
45bool(true)
46===Done===
47