From: k19808 at rtrtr dot com Operating system: Windows XP SP3 PHP version: 5.4.6 Package: Filesystem function related Bug Type: Bug Bug description:Incorrect behavior of RecursiveDirectoryIterator
Description: ------------ Suppose we have a folder "test" in the root of webserver, our script is located in the same folder. There is a file or a folder named "1" in the folder "test". The test script behaves incorrect because of a bug in php. Test script: --------------- $file='./test'; echo "Creating iterator for file: the address is $root.\n"; $file=new RecursiveDirectoryIterator($file,FilesystemIterator::CURRENT_AS_SELF|FilesystemIterator::SKIP_DOTS); echo "Iterator created: the address is ".$root->getPathname()."\n"; Expected result: ---------------- Creating iterator for file: the address is ./test. Iterator created: the address is ./test Actual result: -------------- Creating iterator for file: the address is ./test. Iterator created: the address is ./test\1 -- Edit bug report at https://bugs.php.net/bug.php?id=62872&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62872&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62872&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62872&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62872&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62872&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62872&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62872&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62872&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62872&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62872&r=support Expected behavior: https://bugs.php.net/fix.php?id=62872&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62872&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62872&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62872&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62872&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=62872&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62872&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62872&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62872&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62872&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62872&r=mysqlcfg