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