1--TEST-- 2Test function gzseek() by calling it with SEEK_END when writing 3--SKIPIF-- 4<?php 5if (!extension_loaded("zlib")) { 6 print "skip - ZLIB extension not loaded"; 7} 8?> 9--FILE-- 10<?php 11$f = "temp3.txt.gz"; 12$h = gzopen($f, 'w'); 13$str1 = "This is the first line."; 14$str2 = "This is the second line."; 15gzwrite($h, $str1); 16echo "tell="; 17var_dump(gztell($h)); 18 19//seek to the end which is not sensible of course. 20echo "move to the end of the file\n"; 21var_dump(gzseek($h, 0, SEEK_END)); 22echo "tell="; 23var_dump(gztell($h)); 24gzwrite($h, $str2); 25echo "tell="; 26var_dump(gztell($h)); 27gzclose($h); 28echo "\nreading the output file\n"; 29$h = gzopen($f, 'r'); 30gzpassthru($h); 31gzclose($h); 32echo "\n"; 33unlink($f); 34?> 35===DONE=== 36--EXPECTF-- 37tell=int(23) 38move to the end of the file 39 40Warning: gzseek(): SEEK_END is not supported in %s on line %d 41int(-1) 42tell=int(23) 43tell=int(47) 44 45reading the output file 46This is the first line.This is the second line. 47===DONE===