1--TEST-- 2Phar::buildFromIterator() iterator, SplFileInfo as current tar-based 3--EXTENSIONS-- 4phar 5--INI-- 6phar.readonly=0 7--FILE-- 8<?php 9chdir(__DIR__); 10$phar = new Phar(__DIR__ . '/buildfromiterator8.phar.tar'); 11$a = $phar->buildFromIterator(new RegexIterator(new DirectoryIterator('.'), '/^frontcontroller\d{0,2}\.phar\.phpt\\z|^\.\\z|^\.\.\\z/'), __DIR__ . DIRECTORY_SEPARATOR); 12asort($a); 13var_dump($a); 14var_dump($phar->isFileFormat(Phar::TAR)); 15?> 16--CLEAN-- 17<?php 18unlink(__DIR__ . '/buildfromiterator8.phar.tar'); 19?> 20--EXPECTF-- 21array(21) { 22 ["frontcontroller1.phar.phpt"]=> 23 string(%d) "%sfrontcontroller1.phar.phpt" 24 ["frontcontroller10.phar.phpt"]=> 25 string(%d) "%sfrontcontroller10.phar.phpt" 26 ["frontcontroller11.phar.phpt"]=> 27 string(%d) "%sfrontcontroller11.phar.phpt" 28 ["frontcontroller12.phar.phpt"]=> 29 string(%d) "%sfrontcontroller12.phar.phpt" 30 ["frontcontroller13.phar.phpt"]=> 31 string(%d) "%sfrontcontroller13.phar.phpt" 32 ["frontcontroller14.phar.phpt"]=> 33 string(%d) "%sfrontcontroller14.phar.phpt" 34 ["frontcontroller15.phar.phpt"]=> 35 string(%d) "%sfrontcontroller15.phar.phpt" 36 ["frontcontroller16.phar.phpt"]=> 37 string(%d) "%sfrontcontroller16.phar.phpt" 38 ["frontcontroller17.phar.phpt"]=> 39 string(%d) "%sfrontcontroller17.phar.phpt" 40 ["frontcontroller18.phar.phpt"]=> 41 string(%d) "%sfrontcontroller18.phar.phpt" 42 ["frontcontroller19.phar.phpt"]=> 43 string(%d) "%sfrontcontroller19.phar.phpt" 44 ["frontcontroller2.phar.phpt"]=> 45 string(%d) "%sfrontcontroller2.phar.phpt" 46 ["frontcontroller20.phar.phpt"]=> 47 string(%d) "%sfrontcontroller20.phar.phpt" 48 ["frontcontroller21.phar.phpt"]=> 49 string(%d) "%sfrontcontroller21.phar.phpt" 50 ["frontcontroller3.phar.phpt"]=> 51 string(%d) "%sfrontcontroller3.phar.phpt" 52 ["frontcontroller4.phar.phpt"]=> 53 string(%d) "%sfrontcontroller4.phar.phpt" 54 ["frontcontroller5.phar.phpt"]=> 55 string(%d) "%sfrontcontroller5.phar.phpt" 56 ["frontcontroller6.phar.phpt"]=> 57 string(%d) "%sfrontcontroller6.phar.phpt" 58 ["frontcontroller7.phar.phpt"]=> 59 string(%d) "%sfrontcontroller7.phar.phpt" 60 ["frontcontroller8.phar.phpt"]=> 61 string(%d) "%sfrontcontroller8.phar.phpt" 62 ["frontcontroller9.phar.phpt"]=> 63 string(%d) "%sfrontcontroller9.phar.phpt" 64} 65bool(true) 66