gzseek_variation6.phpt 625 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Test function gzseek() by calling it with SEEK_END when reading
  3. --EXTENSIONS--
  4. zlib
  5. --FILE--
  6. <?php
  7. $f = __DIR__."/004.txt.gz";
  8. $h = gzopen($f, 'r');
  9. // move 40 bytes
  10. echo "move 40 bytes\n";
  11. gzread($h, 40);
  12. echo "tell=";
  13. var_dump(gztell($h));
  14. echo "move to the end\n";
  15. var_dump(gzseek( $h, 0, SEEK_END ) );
  16. echo "tell=";
  17. var_dump(gztell($h));
  18. echo "eof=";
  19. var_dump(gzeof($h));
  20. //read the next 10
  21. var_dump(gzread($h, 10));
  22. gzclose($h);
  23. ?>
  24. --EXPECTF--
  25. move 40 bytes
  26. tell=int(40)
  27. move to the end
  28. Warning: gzseek(): SEEK_END is not supported in %s on line %d
  29. int(-1)
  30. tell=int(40)
  31. eof=bool(false)
  32. string(10) "iny flying"