summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/gzreadgzwrite.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zlib/tests/gzreadgzwrite.phpt')
-rw-r--r--ext/zlib/tests/gzreadgzwrite.phpt9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/zlib/tests/gzreadgzwrite.phpt b/ext/zlib/tests/gzreadgzwrite.phpt
index 6d6729a72f..71d728b6ed 100644
--- a/ext/zlib/tests/gzreadgzwrite.phpt
+++ b/ext/zlib/tests/gzreadgzwrite.phpt
@@ -5,7 +5,7 @@ gzopen(), gzread(), gzwrite()
if (!extension_loaded("zlib")) print "skip"; ?>
--FILE--
<?php
-$original = str_repeat("hallo php",4096);
+$original = str_repeat(b"hallo php",4096);
$filename = tempnam("/tmp", "phpt");
$fp = gzopen($filename, "wb");
@@ -15,7 +15,12 @@ var_dump(gztell($fp));
fclose($fp);
$fp = gzopen($filename, "rb");
-$data = gzread($fp, strlen($original));
+
+$data = '';
+while ($buf = gzread($fp, 8092)) {
+ $data .= $buf;
+}
+
if ($data == $original) {
echo "Strings are equal\n";
} else {