xref: /PHP-8.0/ext/phar/tests/009.phpt (revision 26dfce7f)
1--TEST--
2Phar::mapPhar too many manifest entries
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip");?>
5--INI--
6phar.require_hash=0
7--FILE--
8<?php
9$file = "<?php
10Phar::mapPhar('hio');
11__HALT_COMPILER(); ?>";
12$file .= pack('VVnVVV', 500, 500, 0x1000, 0x00000000, 0, 0) .  str_repeat('A', 500);
13file_put_contents(__DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
14try {
15include __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
16} catch (Exception $e) {
17echo $e->getMessage();
18}
19?>
20--CLEAN--
21<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
22--EXPECTF--
23internal corruption of phar "%s009.phar.php" (too many manifest entries for size of manifest)
24