xref: /PHP-7.2/ext/zlib/tests/gzwrite_error2.phpt (revision f1d7e3ca)
1--TEST--
2Test function gzwrite() by calling it invalid lengths
3--SKIPIF--
4<?php
5if (!extension_loaded("zlib")) {
6	print "skip - ZLIB extension not loaded";
7}
8?>
9--FILE--
10<?php
11
12$filename = "gzwrite_error2.txt.gz";
13$h = gzopen($filename, 'w');
14$str = "Here is the string to be written. ";
15var_dump(gzwrite( $h, $str, 0 ) );
16var_dump(gzwrite( $h, $str, -1 ) );
17gzclose($h);
18
19$h = gzopen($filename, 'r');
20gzpassthru($h);
21gzclose($h);
22echo "\n";
23unlink($filename);
24?>
25===DONE===
26--EXPECT--
27int(0)
28int(0)
29
30===DONE===
31