1--TEST-- 2Test function gzwrite() by calling it when file is opened for reading 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__."/004.txt.gz"; 13$h = gzopen($filename, 'r'); 14$str = "Here is the string to be written. "; 15$length = 10; 16var_dump(gzwrite( $h, $str ) ); 17var_dump(gzread($h, 10)); 18var_dump(gzwrite( $h, $str, $length ) ); 19gzclose($h); 20 21?> 22--EXPECT-- 23int(0) 24string(10) "When you'r" 25int(0) 26