ID: 48881
Updated by: [email protected]
Reported By: domluc at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Linux ws63 2.6.24-24-generic #1
PHP Version: 5.2.10
New Comment:
See bug #45634 for explanation. And never ever submit a bug report
without searching the existing reports first.
Previous Comments:
------------------------------------------------------------------------
[2009-07-10 19:49:14] domluc at gmail dot com
Description:
------------
Working with RecursiveDirectoryIterator bring a weird order in
differrent machines.
if I had a directory with two files:
test1.ext
test2.ext
in some installs the order will be
test1.ext
test2.ext
and in anothers will be
test2.ext
test1.ext
the main problem is that I can't trust in result, so the goal is
iterator guarantee a certain order in all
Reproduce code:
---------------
# you must create a 'test_data_fixtures' dir
# and put two files there test2.yml test1.yml
$dir = 'test_data_fixtures';
$it = new RecursiveDirectoryIterator($dir,
RecursiveIteratorIterator::LEAVES_ONLY);
foreach ($it as $file) {
echo "File: " . $file . "\n";
}
Expected result:
----------------
File: test_data_fixtures/test1.yml
File: test_data_fixtures/test2.yml
Actual result:
--------------
File: test_data_fixtures/test2.yml
File: test_data_fixtures/test1.yml
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48881&edit=1