Doc #69261 [NEW]: getPathname() returns path based on what's passed to the iterator

From: Date: Thu, 19 Mar 2015 09:47:50 +0000
Subject: Doc #69261 [NEW]: getPathname() returns path based on what's passed to the iterator
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12009@lists.php.net to get a copy of this message
From: gulli dot jonsson at gulli dot net Operating system: Fedora 20 PHP version: 5.5.22 Package: Documentation problem Bug Type: Documentation Problem Bug description:getPathname() returns path based on what's passed to the iterator Description: ------------ --- From manual page: http://www.php.net/directoryiterator.getpathname --- This method only gets the pathname based on the path given when creating the DirectoryIterator, not a full pathname. The documentation could be more specific on this. I'm assuming that the documentation is just not accurate enough and that it's not a bug in the method itself. Test script: --------------- <?php foreach (new DirectoryIterator('.') as $file) { print $file->getPathname()."\n"; } foreach (new DirectoryIterator(__DIR__) as $file) { print $file->getPathname()."\n"; } foreach (new DirectoryIterator('somesubdir') as $file) { print $file->getPathname()."\n"; } Expected result: ---------------- Based on the documentation I expected this output (skipped the . and ..) /home/gulli/cli/directoryiterator.php /home/gulli/cli/directoryiterator.php /home/gulli/cli/somesubdir/somefileinsubdir.txt Actual result: -------------- ./directoryiterator.php /home/gulli/cli/directoryiterator.php somesubdir/somefileinsubdir.txt -- Edit bug report at https://bugs.php.net/bug.php?id=69261&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69261&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69261&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69261&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69261&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69261&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69261&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69261&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69261&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69261&r=support Expected behavior: https://bugs.php.net/fix.php?id=69261&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69261&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69261&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69261&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69261&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69261&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69261&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69261&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69261&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69261&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69261&r=mysqlcfg

« previous php.doc.bugs (#12009) next »