gztell_basic.phpt 623 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. Test function gztell() by calling it with its expected arguments when reading
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded("zlib")) {
  6. print "skip - ZLIB extension not loaded";
  7. }
  8. ?>
  9. --FILE--
  10. <?php
  11. $f = dirname(__FILE__)."/004.txt.gz";
  12. $h = gzopen($f, 'r');
  13. $intervals = array(7, 22, 54, 17, 27, 15, 1000);
  14. // tell should be 7, 29, 83, 100, 127, 142, 176 (176 is length of uncompressed file)
  15. var_dump(gztell($h));
  16. foreach ($intervals as $interval) {
  17. gzread($h, $interval);
  18. var_dump(gztell($h));
  19. }
  20. gzclose($h);
  21. ?>
  22. ===DONE===
  23. --EXPECT--
  24. int(0)
  25. int(7)
  26. int(29)
  27. int(83)
  28. int(100)
  29. int(127)
  30. int(142)
  31. int(176)
  32. ===DONE===