세 번째 매개 변수를 통해 덮어쓰기 동작을 변경할 수 있습니다.

$orgDir = 'vfs://root/Helper';
$targetDir = 'vfs://root/HelperBackup';

// 덮어쓰기 않함
directory_mirror($orgDir, $targetDir);
// 덮어쓰기 허용
directory_mirror($orgDir, $targetDir, true);

* vfs://root/HelperBackup
Array
(
    [Arr/] => Array
        (
            [0] => Exam4.php
            [1] => Home.php
            [2] => Exam2.php
            [3] => Exam1.php
            [4] => Exam3.php
        )

    [Date/] => Array
        (
            [0] => Home.php
            [1] => Exam.php
        )

    [Cookie/] => Array
        (
            [0] => Home.php
            [1] => Exam1.php
        )

    [Filesys/] => Array
        (
            [0] => Exam6.php
            [1] => Exam4.php
            [2] => Home.php
            [3] => Exam2.php
            [4] => Exam5.php
            [5] => Exam1.php
            [6] => Exam3.php
        )

)