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