1--TEST-- 2Phar: include/fopen magic zip-based 3--SKIPIF-- 4<?php 5if (!extension_loaded("phar")) die("skip"); 6?> 7--INI-- 8phar.require_hash=0 9phar.readonly=0 10--FILE-- 11<?php 12$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.zip.php'; 13$pname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.zip.php'; 14$p = new Phar($fname); 15var_dump($p->isFileFormat(Phar::ZIP)); 16$p['a'] = '<?php include "b/c.php";' . "\n"; 17$p['b/c.php'] = '<?php echo "in b\n";$a = fopen("a", "r", true);echo stream_get_contents($a);fclose($a);include __DIR__ . "/../d";'; 18$p['d'] = "in d\n"; 19$p->setStub('<?php 20var_dump(__FILE__); 21var_dump(substr(__FILE__, 0, 4) != "phar"); 22set_include_path("phar://" . __FILE__); 23include "phar://" . __FILE__ . "/a"; 24__HALT_COMPILER();'); 25include $pname; 26?> 27--CLEAN-- 28<?php 29unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.zip.php'); 30__HALT_COMPILER(); 31?> 32--EXPECTF-- 33bool(true) 34string(%d) "%sphar_magic.phar.zip.php" 35bool(true) 36in b 37<?php include "b/c.php"; 38in d 39