gzwrite_basic.phpt 485 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Test function gzwrite() by calling it with its expected arguments
  3. --EXTENSIONS--
  4. zlib
  5. --FILE--
  6. <?php
  7. $filename = "gzwrite_basic.txt.gz";
  8. $h = gzopen($filename, 'w');
  9. $str = "Here is the string to be written. ";
  10. $length = 10;
  11. var_dump(gzwrite( $h, $str ) );
  12. var_dump(gzwrite( $h, $str, $length ) );
  13. gzclose($h);
  14. $h = gzopen($filename, 'r');
  15. gzpassthru($h);
  16. gzclose($h);
  17. echo "\n";
  18. unlink($filename);
  19. ?>
  20. --EXPECT--
  21. int(34)
  22. int(10)
  23. Here is the string to be written. Here is th