1--TEST--
2Phar::buildFromIterator() RegexIterator(RecursiveIteratorIterator), SplFileInfo as current
3--SKIPIF--
4<?php
5if (!extension_loaded("phar")) die("skip");
6?>
7--INI--
8phar.require_hash=0
9phar.readonly=0
10--FILE--
11<?php
12try {
13	chdir(dirname(__FILE__));
14	$phar = new Phar(dirname(__FILE__) . '/buildfromiterator.phar');
15	$dir = new RecursiveDirectoryIterator('.');
16	$iter = new RecursiveIteratorIterator($dir);
17	$a = $phar->buildFromIterator(new RegexIterator($iter, '/_\d{3}\.phpt$/'), dirname(__FILE__) . DIRECTORY_SEPARATOR);
18	asort($a);
19	var_dump($a);
20} catch (Exception $e) {
21	var_dump(get_class($e));
22	echo $e->getMessage() . "\n";
23}
24?>
25===DONE===
26--CLEAN--
27<?php
28unlink(dirname(__FILE__) . '/buildfromiterator.phar');
29__HALT_COMPILER();
30?>
31--EXPECTF--
32array(35) {
33  ["phar_ctx_001.phpt"]=>
34  string(%d) "%sphar_ctx_001.phpt"
35  ["phar_get_supported_signatures_001.phpt"]=>
36  string(%d) "%sphar_get_supported_signatures_001.phpt"
37  ["phar_get_supported_signatures_002.phpt"]=>
38  string(%d) "%sphar_get_supported_signatures_002.phpt"
39  ["phar_oo_001.phpt"]=>
40  string(%d) "%sphar_oo_001.phpt"
41  ["phar_oo_002.phpt"]=>
42  string(%d) "%sphar_oo_002.phpt"
43  ["phar_oo_003.phpt"]=>
44  string(%d) "%sphar_oo_003.phpt"
45  ["phar_oo_004.phpt"]=>
46  string(%d) "%sphar_oo_004.phpt"
47  ["phar_oo_005.phpt"]=>
48  string(%d) "%sphar_oo_005.phpt"
49  ["phar_oo_006.phpt"]=>
50  string(%d) "%sphar_oo_006.phpt"
51  ["phar_oo_007.phpt"]=>
52  string(%d) "%sphar_oo_007.phpt"
53  ["phar_oo_008.phpt"]=>
54  string(%d) "%sphar_oo_008.phpt"
55  ["phar_oo_009.phpt"]=>
56  string(%d) "%sphar_oo_009.phpt"
57  ["phar_oo_010.phpt"]=>
58  string(%d) "%sphar_oo_010.phpt"
59  ["phar_oo_011.phpt"]=>
60  string(%d) "%sphar_oo_011.phpt"
61  ["phar_oo_012.phpt"]=>
62  string(%d) "%sphar_oo_012.phpt"
63  ["phar_oo_compressed_001.phpt"]=>
64  string(%d) "%sphar_oo_compressed_001.phpt"
65  ["phar_oo_compressed_002.phpt"]=>
66  string(%d) "%sphar_oo_compressed_002.phpt"
67  ["phpinfo_001.phpt"]=>
68  string(%d) "%sphpinfo_001.phpt"
69  ["phpinfo_002.phpt"]=>
70  string(%d) "%sphpinfo_002.phpt"
71  ["phpinfo_003.phpt"]=>
72  string(%d) "%sphpinfo_003.phpt"
73  ["phpinfo_004.phpt"]=>
74  string(%d) "%sphpinfo_004.phpt"
75  ["tar/tar_001.phpt"]=>
76  string(%d) "%star%ctar_001.phpt"
77  ["tar/tar_002.phpt"]=>
78  string(%d) "%star%ctar_002.phpt"
79  ["tar/tar_003.phpt"]=>
80  string(%d) "%star%ctar_003.phpt"
81  ["tar/tar_004.phpt"]=>
82  string(%d) "%star%ctar_004.phpt"
83  ["zip/corrupt_001.phpt"]=>
84  string(%d) "%szip%ccorrupt_001.phpt"
85  ["zip/corrupt_002.phpt"]=>
86  string(%d) "%szip%ccorrupt_002.phpt"
87  ["zip/corrupt_003.phpt"]=>
88  string(%d) "%szip%ccorrupt_003.phpt"
89  ["zip/corrupt_004.phpt"]=>
90  string(%d) "%szip%ccorrupt_004.phpt"
91  ["zip/corrupt_005.phpt"]=>
92  string(%d) "%szip%ccorrupt_005.phpt"
93  ["zip/corrupt_006.phpt"]=>
94  string(%d) "%szip%ccorrupt_006.phpt"
95  ["zip/corrupt_007.phpt"]=>
96  string(%d) "%szip%ccorrupt_007.phpt"
97  ["zip/corrupt_008.phpt"]=>
98  string(%d) "%szip%ccorrupt_008.phpt"
99  ["zip/corrupt_009.phpt"]=>
100  string(%d) "%szip%ccorrupt_009.phpt"
101  ["zip/corrupt_010.phpt"]=>
102  string(%d) "%szip%ccorrupt_010.phpt"
103}
104===DONE===
105