diff options
author | Pierre Joye <pajoye@php.net> | 2012-01-18 20:21:40 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2012-01-18 20:21:40 +0000 |
commit | 5b72785c684714e494a78f4b46b5449f2b621116 (patch) | |
tree | 61f4035c8655737a045d7bc4d4f1de45f3be4e4f /ext/zlib/tests | |
parent | ccd1b15bd06a388436be2193773489fd10bef26b (diff) | |
download | php-git-5b72785c684714e494a78f4b46b5449f2b621116.tar.gz |
- add test for bug #60761
Diffstat (limited to 'ext/zlib/tests')
-rw-r--r-- | ext/zlib/tests/bug60761.phpt | 33 |
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 0000000000..69b43c09ad --- /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 |