1--TEST--
2Phar::buildFromIterator() RegexIterator(DirectoryIterator), SplFileInfo as current
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--INI--
6phar.readonly=0
7--FILE--
8<?php
9try {
10    chdir(__DIR__);
11    $phar = new Phar(__DIR__ . '/buildfromiterator8.phar');
12    $a = $phar->buildFromIterator(new RegexIterator(new DirectoryIterator('.'), '/^\d{0,3}\.phpt\\z|^\.\\z|^\.\.\\z/'), __DIR__ . DIRECTORY_SEPARATOR);
13    asort($a);
14    var_dump($a);
15} catch (Exception $e) {
16    var_dump(get_class($e));
17    echo $e->getMessage() . "\n";
18}
19?>
20--CLEAN--
21<?php
22unlink(__DIR__ . '/buildfromiterator8.phar');
23__HALT_COMPILER();
24?>
25--EXPECTF--
26array(33) {
27  ["001.phpt"]=>
28  string(%d) "%s001.phpt"
29  ["002.phpt"]=>
30  string(%d) "%s002.phpt"
31  ["003.phpt"]=>
32  string(%d) "%s003.phpt"
33  ["004.phpt"]=>
34  string(%d) "%s004.phpt"
35  ["005.phpt"]=>
36  string(%d) "%s005.phpt"
37  ["006.phpt"]=>
38  string(%d) "%s006.phpt"
39  ["007.phpt"]=>
40  string(%d) "%s007.phpt"
41  ["008.phpt"]=>
42  string(%d) "%s008.phpt"
43  ["009.phpt"]=>
44  string(%d) "%s009.phpt"
45  ["010.phpt"]=>
46  string(%d) "%s010.phpt"
47  ["011.phpt"]=>
48  string(%d) "%s011.phpt"
49  ["012.phpt"]=>
50  string(%d) "%s012.phpt"
51  ["013.phpt"]=>
52  string(%d) "%s013.phpt"
53  ["014.phpt"]=>
54  string(%d) "%s014.phpt"
55  ["015.phpt"]=>
56  string(%d) "%s015.phpt"
57  ["016.phpt"]=>
58  string(%d) "%s016.phpt"
59  ["017.phpt"]=>
60  string(%d) "%s017.phpt"
61  ["018.phpt"]=>
62  string(%d) "%s018.phpt"
63  ["019.phpt"]=>
64  string(%d) "%s019.phpt"
65  ["020.phpt"]=>
66  string(%d) "%s020.phpt"
67  ["021.phpt"]=>
68  string(%d) "%s021.phpt"
69  ["022.phpt"]=>
70  string(%d) "%s022.phpt"
71  ["023.phpt"]=>
72  string(%d) "%s023.phpt"
73  ["024.phpt"]=>
74  string(%d) "%s024.phpt"
75  ["025.phpt"]=>
76  string(%d) "%s025.phpt"
77  ["026.phpt"]=>
78  string(%d) "%s026.phpt"
79  ["027.phpt"]=>
80  string(%d) "%s027.phpt"
81  ["028.phpt"]=>
82  string(%d) "%s028.phpt"
83  ["029.phpt"]=>
84  string(%d) "%s029.phpt"
85  ["030.phpt"]=>
86  string(%d) "%s030.phpt"
87  ["031.phpt"]=>
88  string(%d) "%s031.phpt"
89  ["032.phpt"]=>
90  string(%d) "%s032.phpt"
91  ["033.phpt"]=>
92  string(%d) "%s033.phpt"
93}
94