gzwrite_error2.phpt 513 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Test function gzwrite() by calling it invalid lengths
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded("zlib")) {
  6. print "skip - ZLIB extension not loaded";
  7. }
  8. ?>
  9. --FILE--
  10. <?php
  11. $filename = "gzwrite_error2.txt.gz";
  12. $h = gzopen($filename, 'w');
  13. $str = "Here is the string to be written. ";
  14. var_dump(gzwrite( $h, $str, 0 ) );
  15. var_dump(gzwrite( $h, $str, -1 ) );
  16. gzclose($h);
  17. $h = gzopen($filename, 'r');
  18. gzpassthru($h);
  19. gzclose($h);
  20. echo "\n";
  21. unlink($filename);
  22. ?>
  23. ===DONE===
  24. --EXPECT--
  25. int(0)
  26. int(0)
  27. ===DONE===