php-src/ext/zlib/tests/gzwrite_variation1.phpt
Michael Wallner 11d24c1593 * implement new output API, fixing some bugs and implementing some feature
requests--let's see what I can dig out of the bugtracker for NEWS--
  and while crossing the road:
   * implemented new zlib API
   * fixed up ext/tidy (what was "s&" in zend_parse_parameters() supposed to do?)

Thanks to Jani and Felipe for pioneering.
2010-05-31 10:29:43 +00:00

27 lines
515 B
PHP

--TEST--
Test function gzwrite() by calling it when file is opened for reading
--SKIPIF--
<?php
if (!extension_loaded("zlib")) {
print "skip - ZLIB extension not loaded";
}
?>
--FILE--
<?php
$filename = dirname(__FILE__)."/004.txt.gz";
$h = gzopen($filename, 'r');
$str = b"Here is the string to be written. ";
$length = 10;
var_dump(gzwrite( $h, $str ) );
var_dump(gzread($h, 10));
var_dump(gzwrite( $h, $str, $length ) );
gzclose($h);
?>
===DONE===
--EXPECT--
int(0)
string(10) "When you'r"
int(0)
===DONE===