1--TEST-- 2Test function gzseek() by calling it with SEEK_SET when reading 3--SKIPIF-- 4<?php 5if (!extension_loaded("zlib")) { 6 print "skip - ZLIB extension not loaded"; 7} 8?> 9--FILE-- 10<?php 11$f = __DIR__."/004.txt.gz"; 12$h = gzopen($f, 'r'); 13 14echo "move to the 50th byte\n"; 15var_dump(gzseek( $h, 50, SEEK_SET ) ); 16echo "tell=".gztell($h)."\n"; 17//read the next 10 18var_dump(gzread($h, 10)); 19 20echo "\nmove forward to the 100th byte\n"; 21var_dump(gzseek( $h, 100, SEEK_SET ) ); 22echo "tell=".gztell($h)."\n"; 23//read the next 10 24var_dump(gzread($h, 10)); 25 26echo "\nmove backward to the 20th byte\n"; 27var_dump(gzseek( $h, 20, SEEK_SET ) ); 28echo "tell=".gztell($h)."\n"; 29//read the next 10 30var_dump(gzread($h, 10)); 31gzclose($h); 32?> 33--EXPECT-- 34move to the 50th byte 35int(0) 36tell=50 37string(10) " high abov" 38 39move forward to the 100th byte 40int(0) 41tell=100 42string(10) "Destiny wh" 43 44move backward to the 20th byte 45int(0) 46tell=20 47string(10) "hrough fee" 48