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 = "gzseek_variation7.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--EXPECTF-- 36tell=int(23) 37move to the end of the file 38 39Warning: gzseek(): SEEK_END is not supported in %s on line %d 40int(-1) 41tell=int(23) 42tell=int(47) 43 44reading the output file 45This is the first line.This is the second line. 46