bug76524.phpt 550 B

12345678910111213141516171819202122
  1. --TEST--
  2. ZipArchive Bug #76524 (memory leak with ZipArchive::OVERWRITE flag and empty archive)
  3. --EXTENSIONS--
  4. zip
  5. --FILE--
  6. <?php
  7. $i = 0;
  8. do {
  9. $filename = __DIR__ . "/nonexistent" . ($i++) . ".zip";
  10. } while (file_exists($filename));
  11. $zip = new ZipArchive();
  12. $zip->open($filename, ZipArchive::CREATE | ZipArchive::OVERWRITE);
  13. echo 'ok';
  14. /* Zip-related error messages depend on platform and libzip version,
  15. so the regex is used to check that Zend MM does NOT show warnings
  16. about leaks: */
  17. ?>
  18. --EXPECTREGEX--
  19. ok((?!memory leaks detected).)*