note 98155 rejected from recursivedirectoryiterator.construct by danbrown
| From: | danbrown@php.net | Date: | Tue, 01 Jun 2010 14:59:40 +0000 |
| Subject: | note 98155 rejected from recursivedirectoryiterator.construct by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-169801@lists.php.net to get a copy of this message | ||
Note Submitter: cataphract at php dot net
----
The example is a bit misleading. The isDot call is there to remove the first three entries (the
"." directory twice and then the ".." directory), which should not be there
anyway because the default mode is "LEAVES_ONLY" and hence the directories should not be
shown anyway.
The SPL iterators are designed for use in foreach. See http://bugs.php.net/bug.php?id=44063
In this case, the isDot call should be removed and a rewind call before the loop should be added.