summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/gzeof_variation1.phpt
blob: 3be013facfa04291092e59916badb878bf1b7a5a (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
31
--TEST--
Test function gzeof while writing.
--SKIPIF--
<?php
if (!extension_loaded("zlib")) {
    print "skip - ZLIB extension not loaded";
}
?>
--FILE--
<?php

$filename = __DIR__."/gzeof_variation1.txt.gz";
$h = gzopen($filename, 'w');
$str = "Here is the string to be written. ";
$length = 10;
gzwrite( $h, $str );
var_dump(gzeof($h));
gzwrite( $h, $str, $length);
var_dump(gzeof($h));
gzclose($h);
try {
    var_dump(gzeof($h));
} catch (TypeError $e) {
    echo $e->getMessage(), "\n";
}
unlink($filename);
?>
--EXPECT--
bool(false)
bool(false)
gzeof(): supplied resource is not a valid stream resource