1--TEST-- 2Test function gzseek() by calling it with SEEK_CUR 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_CUR ) ); 16echo "tell=".gztell($h)."\n"; 17//read the next 10 18var_dump(gzread($h, 10)); 19 20echo "\nmove forward to the 94th byte\n"; 21var_dump(gzseek( $h, 34, SEEK_CUR ) ); 22echo "tell=".gztell($h)."\n"; 23//read the next 10 24var_dump(gzread($h, 10)); 25 26echo "\nmove backward to the 77th byte\n"; 27var_dump(gzseek( $h, -27, SEEK_CUR ) ); 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 94th byte 40int(0) 41tell=94 42string(10) "ze it 43Dest" 44 45move backward to the 77th byte 46int(0) 47tell=77 48string(10) "hat you ca" 49