gzrewind_basic.phpt 814 B

123456789101112131415161718192021222324252627282930313233343536
  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. echo "test rewind before doing anything\n";
  14. var_dump(gzrewind($h));
  15. var_dump(gztell($h));
  16. echo "\nfirst 30 characters=".gzread($h, 30)."\n";
  17. var_dump(gztell($h));
  18. gzrewind($h);
  19. var_dump(gztell($h));
  20. echo "first 10 characters=".gzread($h, 10)."\n";
  21. gzrewind($h);
  22. echo "first 20 characters=".gzread($h, 20)."\n";
  23. gzclose($h);
  24. ?>
  25. ===DONE===
  26. --EXPECT--
  27. test rewind before doing anything
  28. bool(true)
  29. int(0)
  30. first 30 characters=When you're taught through fee
  31. int(30)
  32. int(0)
  33. first 10 characters=When you'r
  34. first 20 characters=When you're taught t
  35. ===DONE===