gzinflate_error1.phpt 545 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Test gzinflate() function : error conditions
  3. --EXTENSIONS--
  4. zlib
  5. --FILE--
  6. <?php
  7. include(__DIR__ . '/data.inc');
  8. echo "*** Testing gzinflate() : error conditions ***\n";
  9. echo "\n-- Testing with a buffer that is too small --\n";
  10. $data = 'string_val';
  11. $short_len = strlen($data) - 1;
  12. $compressed = gzcompress($data);
  13. var_dump(gzinflate($compressed, $short_len));
  14. ?>
  15. --EXPECTF--
  16. *** Testing gzinflate() : error conditions ***
  17. -- Testing with a buffer that is too small --
  18. Warning: gzinflate(): data error in %s on line %d
  19. bool(false)