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