With or without "RecursiveIteratorIterator::SELF_FIRST", both works. The problem is when you extract it.

The phar file created by buildFromIterator() can not extracted correctly, it will treat the folder as file. Take the following for example:

    A.txt
    B.txt
    C/D.txt

It has tree files in this phar. When using buildFromIterator(), it will treat it as 4 files,
1. A.txt
2. B.txt
3. C <= Should be folder, but  buildFromIterator() treat it as file
4. C/D.txt

So, you can not extract correctly, when you want to extract to file system. But it works with PHP without any problem.

I choose addFile() to avoid this.