gzwrite_variation1.phpt 403 B

123456789101112131415161718192021
  1. --TEST--
  2. Test function gzwrite() by calling it when file is opened for reading
  3. --EXTENSIONS--
  4. zlib
  5. --FILE--
  6. <?php
  7. $filename = __DIR__."/004.txt.gz";
  8. $h = gzopen($filename, 'r');
  9. $str = "Here is the string to be written. ";
  10. $length = 10;
  11. var_dump(gzwrite( $h, $str ) );
  12. var_dump(gzread($h, 10));
  13. var_dump(gzwrite( $h, $str, $length ) );
  14. gzclose($h);
  15. ?>
  16. --EXPECT--
  17. int(0)
  18. string(10) "When you'r"
  19. int(0)