|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-11-09 01:48 UTC] k-gun at mail dot com
-: krmgns at gmail dot com
+: k-gun at mail dot com
-PHP Version: 7.4.0RC5
+PHP Version: 7.4.0RC4
[2019-11-09 01:48 UTC] k-gun at mail dot com
[2019-11-09 03:19 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2019-11-09 03:19 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 10:00:01 2025 UTC |
Description: ------------ Hi, Calling iterator_count() is affecting RecursiveDirectoryIterator::valid() and RecursiveDirectoryIterator::valid() is returning false after iterator_count() call. I am not sure that is a bug or just a behavior of PHP, but simply looks weird invalidating it without any iteration act such as while or foreach. Test script: --------------- $iter = new RecursiveDirectoryIterator("/tmp/", RecursiveDirectoryIterator::SKIP_DOTS); var_dump($iter->valid()); var_dump(iterator_count($iter)); var_dump($iter->valid()); Expected result: ---------------- bool(true) int(24) bool(true) Actual result: -------------- bool(true) int(24) bool(false)