1--TEST--
2Test function gzeof while writing.
3--SKIPIF--
4<?php
5if (!extension_loaded("zlib")) {
6    print "skip - ZLIB extension not loaded";
7}
8?>
9--FILE--
10<?php
11
12$filename = __DIR__."/gzeof_variation1.txt.gz";
13$h = gzopen($filename, 'w');
14$str = "Here is the string to be written. ";
15$length = 10;
16gzwrite( $h, $str );
17var_dump(gzeof($h));
18gzwrite( $h, $str, $length);
19var_dump(gzeof($h));
20gzclose($h);
21try {
22    var_dump(gzeof($h));
23} catch (TypeError $e) {
24    echo $e->getMessage(), "\n";
25}
26unlink($filename);
27?>
28--EXPECT--
29bool(false)
30bool(false)
31gzeof(): supplied resource is not a valid stream resource
32