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

From: Date: Wed, 24 Nov 2010 23:00:13 +0000
Subject: Doc #53401 [NEW]: dirname() and basename() documentation unclear/incorrect for Windows
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5582@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=51830 about the documentation for basename and dirname, which was mostly addressed by revision 305142, 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. The output given for the examples is correct on UNIX, but not on Windows, where this is the actual output: 1) /etc 2) \ 3) . So 2) outputs a backslash instead of a slash. 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=53401&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53401&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53401&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53401&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53401&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53401&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53401&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53401&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53401&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53401&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53401&r=support Expected behavior: http://bugs.php.net/fix.php?id=53401&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53401&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53401&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53401&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53401&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=53401&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53401&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53401&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53401&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53401&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53401&r=mysqlcfg

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