gztell_basic.phpt 512 B

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