summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/gzwrite_error2.phpt
blob: 0cd0baa14e88408d9e6d6cd23ee4ebc4b3d43792 (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
--TEST--
Test function gzwrite() by calling it invalid lengths
--SKIPIF--
<?php
if (!extension_loaded("zlib")) {
	print "skip - ZLIB extension not loaded";
}
?>
--FILE--
<?php

$filename = "gzwrite_error2.txt.gz";
$h = gzopen($filename, 'w');
$str = "Here is the string to be written. ";
var_dump(gzwrite( $h, $str, 0 ) );
var_dump(gzwrite( $h, $str, -1 ) );
gzclose($h);

$h = gzopen($filename, 'r');
gzpassthru($h);
gzclose($h);
echo "\n";
unlink($filename);
?>
===DONE===
--EXPECT--
int(0)
int(0)

===DONE===