xref: /PHP-7.1/ext/zlib/tests/bug67724.phpt (revision e4ff7f2e)
1--TEST--
2Bug #67724 (chained zlib filters silently fail with large amounts of data)
3--SKIPIF--
4<?php
5extension_loaded("zlib") or die("skip need ext/zlib");
6?>
7--FILE--
8<?php
9echo "Test\n";
10
11$f = fopen(__DIR__."/bug67724.gz.gz", "rb")
12	or die(current(error_get_last()));
13stream_filter_append($f, "zlib.inflate", STREAM_FILTER_READ, ["window" => 30]);
14stream_filter_append($f, "zlib.inflate", STREAM_FILTER_READ, ["window" => 30]);
15for ($i = 0; !feof($f); $i += strlen(fread($f, 0x1000)))
16	;
17fclose($f);
18
19var_dump($i);
20
21?>
22DONE
23--EXPECT--
24Test
25int(25600000)
26DONE
27