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