gzrewind_basic2.phpt 684 B

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