mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
- add test for bug #60761
This commit is contained in:
parent
e11ece1ca7
commit
f6ea9cecfa
1 changed files with 33 additions and 0 deletions
33
ext/zlib/tests/bug60761.phpt
Normal file
33
ext/zlib/tests/bug60761.phpt
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
--TEST--
|
||||||
|
checks zlib compression size is always the same no matter how many times its run
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
phpinfo();
|
||||||
|
$html = ob_get_clean();
|
||||||
|
|
||||||
|
$lens = array();
|
||||||
|
|
||||||
|
for ( $i=0 ; $i < 200 ; $i++ ) {
|
||||||
|
//zlib.output_compression = On
|
||||||
|
//zlib.output_compression_level = 9
|
||||||
|
$compressed = gzcompress($html, 9);
|
||||||
|
|
||||||
|
$len = strlen($compressed);
|
||||||
|
|
||||||
|
$lens[$len] = $len;
|
||||||
|
}
|
||||||
|
|
||||||
|
$lens = array_values($lens);
|
||||||
|
|
||||||
|
echo "Compressed lengths\n";
|
||||||
|
var_dump($lens);
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTREGEX--
|
||||||
|
Compressed lengths
|
||||||
|
array(1) {
|
||||||
|
[0]=>
|
||||||
|
int(%d)
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue