|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-04-30 02:19 UTC] marcelo at ofload dot com
[2022-08-25 05:38 UTC] staffan at njoy dot fi
[2024-01-04 20:30 UTC] bukka@php.net
-Package: *Directory/Filesystem functions
+Package: SPL related
[2024-05-10 09:10 UTC] Lorena783lopez at outlook dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 15:00:01 2025 UTC |
Description: ------------ As for my testing, FilesystemIterator fails with the foreach loop while the while-next loop works as expected. Test script: --------------- <?php $iterator = new \FilesystemIterator( '/fuse-filesystem', \FilesystemIterator::CURRENT_AS_SELF | \FilesystemIterator::SKIP_DOTS ); echo "--while\n"; while($iterator->valid()) { echo $iterator->current()."\n"; $iterator->next(); } $iterator->rewind(); echo "--for\n"; foreach ($iterator as $entry) { echo $entry->getFilename()."\n"; } Expected result: ---------------- --while .hg file1.class.php file2.class.php --for .hg file1.class.php file2.class.php Actual result: -------------- --while .hg file1.class.php file2.class.php --for