summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/gzwrite_variation1.phpt
blob: ab6c2606b4e851d8d03c183fdfbcf5e4ce8c558e (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
--TEST--
Test function gzwrite() by calling it when file is opened for reading
--SKIPIF--
<?php 
if (!extension_loaded("zlib")) {
	print "skip - ZLIB extension not loaded"; 
}
?>
--FILE--
<?php

$filename = dirname(__FILE__)."/004.txt.gz";
$h = gzopen($filename, 'r');
$str = b"Here is the string to be written. ";
$length = 10;
var_dump(gzwrite( $h, $str ) );
var_dump(gzread($h, 10));
var_dump(gzwrite( $h, $str, $length ) );
gzclose($h);

?>
===DONE===
--EXPECT--
int(0)
string(10) "When you'r"
int(0)
===DONE===