xref: /PHP-7.2/ext/phar/tests/bug53872.phpt (revision f1d7e3ca)
1--TEST--
2bug#53872 (internal corruption of phar)
3--SKIPIF--
4<?php
5if (!extension_loaded("phar")) die("skip");
6if (!extension_loaded("zlib")) die("skip Test needs ext/zlib");
7?>
8--INI--
9phar.readonly=0
10--FILE--
11<?php
12$p=new Phar('bug53872-phar.phar');
13$p->buildFromDirectory(__DIR__ . "/bug53872/");
14$p->setStub('<?php __HALT_COMPILER();?\>');
15$p->compressFiles(Phar::GZ);
16
17print(file_get_contents('phar://bug53872-phar.phar/first.txt'));
18print(file_get_contents('phar://bug53872-phar.phar/second.txt'));
19print(file_get_contents('phar://bug53872-phar.phar/third.txt'));
20?>
21--CLEAN--
22<?php
23unlink("bug53872-phar.phar");
24?>
25--EXPECT--
26content of first.txt
27content of third.txt
28