diff options
| author | Christoph M. Becker <cmbecker69@gmx.de> | 2021-02-22 15:33:57 +0100 |
|---|---|---|
| committer | Christoph M. Becker <cmbecker69@gmx.de> | 2021-02-22 15:33:57 +0100 |
| commit | 7f8ea83ef438fbcfa1cbc636d701491d4e773245 (patch) | |
| tree | 80bea3c80e97260ff965111a71d5cc21399c99a9 /ext/standard/tests | |
| parent | 4c6533c257cfabd5dd78988bb277f410b2778140 (diff) | |
| parent | b418fe266dd3ab56358469ed8290187959bad1a7 (diff) | |
| download | php-git-7f8ea83ef438fbcfa1cbc636d701491d4e773245.tar.gz | |
Merge branch 'PHP-8.0'
* PHP-8.0:
Fix #75776: Flushing streams with compression filter is broken
Diffstat (limited to 'ext/standard/tests')
| -rw-r--r-- | ext/standard/tests/streams/bug75776.phpt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ext/standard/tests/streams/bug75776.phpt b/ext/standard/tests/streams/bug75776.phpt new file mode 100644 index 0000000000..2bb78ec621 --- /dev/null +++ b/ext/standard/tests/streams/bug75776.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug #75776 (Flushing streams with compression filter is broken) +--SKIPIF-- +<?php +if (!extension_loaded('zlib')) die('skip zlib extension not available'); +if (!extension_loaded('bz2')) die('skip bz2 extension not available'); +?> +--FILE-- +<?php +$compression = [ + 'gz' => ['zlib.deflate', 'gzinflate'], + 'bz2' => ['bzip2.compress', 'bzdecompress'] +]; +foreach ($compression as $ext => [$filter, $function]) { + $stream = fopen(__DIR__ . "/75776.$ext", 'w'); + stream_filter_append($stream, $filter); + fwrite($stream,"sdfgdfg"); + fflush($stream); + fclose($stream); + + $compressed = file_get_contents(__DIR__ . "/75776.$ext"); + var_dump($function($compressed)); +} +?> +--EXPECT-- +string(7) "sdfgdfg" +string(7) "sdfgdfg" +--CLEAN-- +<?php +@unlink(__DIR__ . "/75776.gz"); +@unlink(__DIR__ . "/75776.bz2"); +?> |
