Doc #54536 [NEW]: dirname() and basename() documentation unclear/incorrect for Windows

From: Date: Fri, 15 Apr 2011 04:31:28 +0000
Subject: Doc #54536 [NEW]: dirname() and basename() documentation unclear/incorrect for Windows
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-6236@lists.php.net to get a copy of this message
From: Operating system: PHP version: Irrelevant Package: Documentation problem Bug Type: Documentation Problem Bug description:dirname() and basename() documentation unclear/incorrect for Windows Description: ------------ Hi, earlier I reported http://bugs.php.net/bug.php?id=53401 about the documentation for basename and dirname, which was partly addressed by revision 308194, but there are still a few issues, in particular for Windows. Again this bug report is wide. http://www.php.net/manual/en/function.dirname.php http://www.php.net/manual/en/function.basename.php The basename page describes the return value: Returns the base name of the given path. But a path can have no basename if it has no component. Also, the suffix parameter is described: If the name component ends in suffix this will also be cut off. The path can have several filename components, I suppose this should read: If the basename ends in suffix this will also be cut off. The dirname page has more Windows-specific issues. Problems are mostly with edge cases. The following is said about the return value: If there are no slashes in path, a dot ('.') is returned, indicating the current directory. Otherwise, the returned string is path with any trailing /component removed. As shown in example 2, even if there is a slash, the operation is more complex than removing a trailing slash followed by a component. dirname can also remove a slash followed by a component followed by a slash. And this is only valid on UNIX; on Windows backslashes are considered too. dirname documentation refers to the parent directory, but eventually, there is no more parent directory (like for "/"). -- Edit bug report at http://bugs.php.net/bug.php?id=54536&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54536&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54536&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54536&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54536&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54536&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54536&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54536&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54536&r=needscript Try newer version: http://bugs.php.net/fix.php?id=54536&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54536&r=support Expected behavior: http://bugs.php.net/fix.php?id=54536&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54536&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54536&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54536&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54536&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=54536&r=dst IIS Stability: http://bugs.php.net/fix.php?id=54536&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54536&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54536&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54536&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54536&r=mysqlcfg

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