xref: /PHP-8.0/ext/zlib/tests/gzwrite_error2.phpt (revision c5401854)
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--EXPECT--
26int(0)
27int(0)
28
29