gzread_variation1.phpt 526 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Test function gzread() by calling it while file open for writing
  3. --EXTENSIONS--
  4. zlib
  5. --FILE--
  6. <?php
  7. $filename = "gzread_variation1.txt.gz";
  8. $h = gzopen($filename, 'w');
  9. $str = "Here is the string to be written. ";
  10. var_dump(gzread($h, 100));
  11. gzwrite( $h, $str);
  12. var_dump(gzread($h, 100));
  13. gzrewind($h);
  14. var_dump(gzread($h, 100));
  15. gzclose($h);
  16. $h = gzopen($filename, 'r');
  17. gzpassthru($h);
  18. gzclose($h);
  19. echo "\n";
  20. unlink($filename);
  21. ?>
  22. --EXPECT--
  23. bool(false)
  24. bool(false)
  25. bool(false)
  26. Here is the string to be written.