xref: /PHP-7.1/ext/phar/tests/009.phpt (revision 228c2886)
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 = b"<?php
10Phar::mapPhar('hio');
11__HALT_COMPILER(); ?>";
12$file .= (binary) pack(b'VVnVVV', 500, 500, 0x1000, 0x00000000, 0, 0) . (binary) str_repeat((binary)'A', 500);
13file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
14try {
15include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
16} catch (Exception $e) {
17echo $e->getMessage();
18}
19?>
20--CLEAN--
21<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
22--EXPECTF--
23internal corruption of phar "%s009.phar.php" (too many manifest entries for size of manifest)
24