xref: /PHP-8.1/ext/phar/tests/023.phpt (revision 74859783)
1--TEST--
2Phar: phar:// file_get_contents
3--EXTENSIONS--
4phar
5--INI--
6phar.require_hash=0
7--FILE--
8<?php
9$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
10$pname = 'phar://' . $fname;
11$file = "<?php __HALT_COMPILER(); ?>";
12
13$files = array();
14$files['a.php'] = '<?php echo "This is a\n"; ?>';
15$files['b.php'] = '<?php echo "This is b\n"; ?>';
16$files['b/c.php'] = '<?php echo "This is b/c\n"; ?>';
17
18include 'files/phar_test.inc';
19
20var_dump(file_get_contents($pname . '/a.php'));
21var_dump(file_get_contents($pname . '/b.php'));
22var_dump(file_get_contents($pname . '/b/c.php'));
23
24?>
25--CLEAN--
26<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
27--EXPECT--
28string(28) "<?php echo "This is a\n"; ?>"
29string(28) "<?php echo "This is b\n"; ?>"
30string(30) "<?php echo "This is b/c\n"; ?>"
31