gzrewind_basic2.phpt 573 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Test function gzrewind() 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. // read to the end of the file
  10. echo "read to the end of the file, then rewind\n";
  11. gzread($h, 10000);
  12. var_dump(gzeof($h));
  13. var_dump(gztell($h));
  14. gzrewind($h);
  15. var_dump(gzeof($h));
  16. var_dump(gztell($h));
  17. echo "first 20 characters=".gzread($h,20)."\n";
  18. gzclose($h);
  19. ?>
  20. --EXPECT--
  21. read to the end of the file, then rewind
  22. bool(true)
  23. int(176)
  24. bool(false)
  25. int(0)
  26. first 20 characters=When you're taught t