xref: /PHP-7.2/ext/zlib/tests/gzread_error2.phpt (revision f1d7e3ca)
1--TEST--
2Test function gzread() 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$f = dirname(__FILE__)."/004.txt.gz";
12$h = gzopen($f, 'r');
13var_dump(gzread($h, 10));
14var_dump(gzread($h, 0));
15var_dump(gzread($h, 5));
16var_dump(gzread($h, -1));
17var_dump(gzread($h, 8));
18gzclose($h);
19
20?>
21===DONE===
22--EXPECTF--
23string(10) "When you'r"
24
25Warning: gzread(): Length parameter must be greater than 0 in %s on line %d
26bool(false)
27string(5) "e tau"
28
29Warning: gzread(): Length parameter must be greater than 0 in %s on line %d
30bool(false)
31string(8) "ght thro"
32===DONE===
33