016b.phpt 730 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Phar::mapPhar invalid file (gzipped file length is too short)
  3. --EXTENSIONS--
  4. phar
  5. zlib
  6. --INI--
  7. phar.require_hash=0
  8. --FILE--
  9. <?php
  10. $fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
  11. $pname = 'phar://' . $fname;
  12. $file = "<?php __HALT_COMPILER(); ?>";
  13. // file length is too short
  14. $files = array();
  15. $files['a'] = array('cont'=>'a','flags'=>0x00001000, 'clen' => 1);
  16. include 'files/phar_test.inc';
  17. echo file_get_contents($pname . '/a');
  18. ?>
  19. --CLEAN--
  20. <?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
  21. --EXPECTF--
  22. Warning: file_get_contents(phar://%s/a): Failed to open stream: phar error: internal corruption of phar "%s" (actual filesize mismatch on file "a") in %s on line %d