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
29foreach(range(1, 4) as $i) {
30    unlink(__DIR__ . "/testdir6/file$i.txt");
31}
32rmdir(__DIR__ . '/testdir6');
33?>
34--EXPECT--
35array(0) {
36}
37bool(false)
38