blob: 6d6729a72f68275c73d1c6bd07a217a13508c578 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
--TEST--
gzopen(), gzread(), gzwrite()
--SKIPIF--
<?php # vim600:syn=php:
if (!extension_loaded("zlib")) print "skip"; ?>
--FILE--
<?php
$original = str_repeat("hallo php",4096);
$filename = tempnam("/tmp", "phpt");
$fp = gzopen($filename, "wb");
gzwrite($fp, $original);
var_dump(strlen($original));
var_dump(gztell($fp));
fclose($fp);
$fp = gzopen($filename, "rb");
$data = gzread($fp, strlen($original));
if ($data == $original) {
echo "Strings are equal\n";
} else {
echo "Strings are not equal\n";
var_dump($data);
}
gzclose($fp);
unlink($filename);
?>
--EXPECT--
int(36864)
int(36864)
Strings are equal
|