xref: /PHP-8.2/ext/phar/tests/021.phpt (revision 74859783)
1--TEST--
2Phar: stream stat
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
12Phar::mapPhar('hio');
13__HALT_COMPILER(); ?>";
14
15$files = array();
16$files['a'] = 'a';
17$files['b/a'] = 'b';
18$files['b/c/d'] = 'c';
19$files['bad/c'] = 'd';
20
21include 'files/phar_test.inc';
22
23include $fname;
24
25$fp = fopen('phar://hio/a', 'r');
26var_dump(fstat($fp));
27fclose($fp);
28?>
29--CLEAN--
30<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
31--EXPECTF--
32array(26) {
33  [0]=>
34  int(12)
35  [1]=>
36  int(%d)
37  [2]=>
38  int(33060)
39  [3]=>
40  int(1)
41  [4]=>
42  int(0)
43  [5]=>
44  int(0)
45  [6]=>
46  int(-1)
47  [7]=>
48  int(1)
49  [8]=>
50  int(%d)
51  [9]=>
52  int(%d)
53  [10]=>
54  int(%d)
55  [11]=>
56  int(-1)
57  [12]=>
58  int(-1)
59  [%sdev"]=>
60  int(12)
61  [%sino"]=>
62  int(%d)
63  [%smode"]=>
64  int(33060)
65  [%snlink"]=>
66  int(1)
67  [%suid"]=>
68  int(0)
69  [%sgid"]=>
70  int(0)
71  [%srdev"]=>
72  int(-1)
73  [%ssize"]=>
74  int(1)
75  [%satime"]=>
76  int(%d)
77  [%smtime"]=>
78  int(%d)
79  [%sctime"]=>
80  int(%d)
81  [%sblksize"]=>
82  int(-1)
83  [%sblocks"]=>
84  int(-1)
85}
86