summaryrefslogtreecommitdiff
path: root/ext/zlib/tests
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2012-01-18 20:21:40 (GMT)
committerPierre Joye <pajoye@php.net>2012-01-18 20:21:40 (GMT)
commitf6ea9cecfa437118ed8daeb44995fb03462d08c8 (patch)
tree46a3ee458650d4e3220d3b8a60153549824b9cd4 /ext/zlib/tests
parente11ece1ca7b6c437354ead32bbf04dfb12f0369a (diff)
downloadphp-f6ea9cecfa437118ed8daeb44995fb03462d08c8.tar.gz
- add test for bug #60761
Diffstat (limited to 'ext/zlib/tests')
-rw-r--r--ext/zlib/tests/bug60761.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/zlib/tests/bug60761.phpt b/ext/zlib/tests/bug60761.phpt
new file mode 100644
index 0000000..69b43c0
--- /dev/null
+++ b/ext/zlib/tests/bug60761.phpt
@@ -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)
+} \ No newline at end of file