Wednesday, March 02, 2011

PHP 5.3 DirectoryIterator::getPathname bug on root

Using DirectoryIterator on root results in a different behavior of getPathname.

before 5.3 the output would be something like:
/var
/etc
...

after 5.3 it is:
//var
//etc
...
what the heck is it with the doubleslashes? It's only happening if you are using Root as the Directory to start with
new DirectoryIterator('/');
Although it seems to me like a bug, i found nothing on google. Reporting it was not possible as i am using a debian distributed version and i already know their answer. "Use the original one first"