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(__DIR__);
14    $phar = new Phar(__DIR__ . '/buildfromiterator10.phar');
15    $dir = new RecursiveDirectoryIterator('.');
16    $iter = new RecursiveIteratorIterator($dir);
17    $a = $phar->buildFromIterator(new RegexIterator($iter, '/_\d{3}\.phpt$/'), __DIR__ . 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--CLEAN--
26<?php
27unlink(__DIR__ . '/buildfromiterator10.phar');
28__HALT_COMPILER();
29?>
30--EXPECTF--
31array(34) {
32  ["phar_ctx_001.phpt"]=>
33  string(%d) "%sphar_ctx_001.phpt"
34  ["phar_get_supported_signatures_002.phpt"]=>
35  string(%d) "%sphar_get_supported_signatures_002.phpt"
36  ["phar_oo_001.phpt"]=>
37  string(%d) "%sphar_oo_001.phpt"
38  ["phar_oo_002.phpt"]=>
39  string(%d) "%sphar_oo_002.phpt"
40  ["phar_oo_003.phpt"]=>
41  string(%d) "%sphar_oo_003.phpt"
42  ["phar_oo_004.phpt"]=>
43  string(%d) "%sphar_oo_004.phpt"
44  ["phar_oo_005.phpt"]=>
45  string(%d) "%sphar_oo_005.phpt"
46  ["phar_oo_006.phpt"]=>
47  string(%d) "%sphar_oo_006.phpt"
48  ["phar_oo_007.phpt"]=>
49  string(%d) "%sphar_oo_007.phpt"
50  ["phar_oo_008.phpt"]=>
51  string(%d) "%sphar_oo_008.phpt"
52  ["phar_oo_009.phpt"]=>
53  string(%d) "%sphar_oo_009.phpt"
54  ["phar_oo_010.phpt"]=>
55  string(%d) "%sphar_oo_010.phpt"
56  ["phar_oo_011.phpt"]=>
57  string(%d) "%sphar_oo_011.phpt"
58  ["phar_oo_012.phpt"]=>
59  string(%d) "%sphar_oo_012.phpt"
60  ["phar_oo_compressed_001.phpt"]=>
61  string(%d) "%sphar_oo_compressed_001.phpt"
62  ["phar_oo_compressed_002.phpt"]=>
63  string(%d) "%sphar_oo_compressed_002.phpt"
64  ["phpinfo_001.phpt"]=>
65  string(%d) "%sphpinfo_001.phpt"
66  ["phpinfo_002.phpt"]=>
67  string(%d) "%sphpinfo_002.phpt"
68  ["phpinfo_003.phpt"]=>
69  string(%d) "%sphpinfo_003.phpt"
70  ["phpinfo_004.phpt"]=>
71  string(%d) "%sphpinfo_004.phpt"
72  ["tar/tar_001.phpt"]=>
73  string(%d) "%star%ctar_001.phpt"
74  ["tar/tar_002.phpt"]=>
75  string(%d) "%star%ctar_002.phpt"
76  ["tar/tar_003.phpt"]=>
77  string(%d) "%star%ctar_003.phpt"
78  ["tar/tar_004.phpt"]=>
79  string(%d) "%star%ctar_004.phpt"
80  ["zip/corrupt_001.phpt"]=>
81  string(%d) "%szip%ccorrupt_001.phpt"
82  ["zip/corrupt_002.phpt"]=>
83  string(%d) "%szip%ccorrupt_002.phpt"
84  ["zip/corrupt_003.phpt"]=>
85  string(%d) "%szip%ccorrupt_003.phpt"
86  ["zip/corrupt_004.phpt"]=>
87  string(%d) "%szip%ccorrupt_004.phpt"
88  ["zip/corrupt_005.phpt"]=>
89  string(%d) "%szip%ccorrupt_005.phpt"
90  ["zip/corrupt_006.phpt"]=>
91  string(%d) "%szip%ccorrupt_006.phpt"
92  ["zip/corrupt_007.phpt"]=>
93  string(%d) "%szip%ccorrupt_007.phpt"
94  ["zip/corrupt_008.phpt"]=>
95  string(%d) "%szip%ccorrupt_008.phpt"
96  ["zip/corrupt_009.phpt"]=>
97  string(%d) "%szip%ccorrupt_009.phpt"
98  ["zip/corrupt_010.phpt"]=>
99  string(%d) "%szip%ccorrupt_010.phpt"
100}
101