gzrewind_basic.phpt 703 B

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