summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/zlib_wrapper_fflush_basic.phpt
blob: de1318cfed7a80f2e1c8a91729738fb4baebbd16 (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
32
33
--TEST--
Test function fflush() on a zlib stream wrapper
--SKIPIF--
<?php 
if (!extension_loaded("zlib")) {
	print "skip - ZLIB extension not loaded"; 
}
?>
--FILE--
<?php

$filename = "zlib_wrapper_fflush_basic.txt.gz";
$h = gzopen($filename, 'w');
$str = "Here is the string to be written.";
$length = 10;
var_dump(fflush($h));
gzwrite( $h, $str);
gzwrite( $h, $str);
var_dump(fflush($h));
gzclose($h);

$h = gzopen($filename, 'r');
gzpassthru($h);
gzclose($h);
echo "\n";
unlink($filename);
?>
===DONE===
--EXPECT--
bool(true)
bool(true)
Here is the string to be written.Here is the string to be written.
===DONE===