1--TEST--
2Phar::buildFromDirectory() with non-matching regex
3--EXTENSIONS--
4phar
5--INI--
6phar.require_hash=0
7phar.readonly=0
8--FILE--
9<?php
10
11mkdir(__DIR__.'/testdir6', 0777);
12foreach(range(1, 4) as $i) {
13    file_put_contents(__DIR__."/testdir6/file$i.txt", "some content for file $i");
14}
15
16try {
17    $phar = new Phar(__DIR__ . '/buildfromdirectory6.phar');
18    var_dump($phar->buildFromDirectory(__DIR__ . '/testdir6', '/\.php$/'));
19} catch (Exception $e) {
20    var_dump(get_class($e));
21    echo $e->getMessage() . "\n";
22}
23
24var_dump(file_exists(__DIR__ . '/buildfromdirectory6.phar'));
25
26?>
27--CLEAN--
28<?php
29unlink(__DIR__ . '/buildfromdirectory6.phar');
30foreach(range(1, 4) as $i) {
31    unlink(__DIR__ . "/testdir6/file$i.txt");
32}
33rmdir(__DIR__ . '/testdir6');
34?>
35--EXPECT--
36array(0) {
37}
38bool(false)
39