Bug #51830 [NEW]: dirname() and basename() documentation unclear/incorrect

From: Date: Fri, 14 May 2010 20:41:08 +0000
Subject: Bug #51830 [NEW]: dirname() and basename() documentation unclear/incorrect
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4375@lists.php.net to get a copy of this message
From: Operating system: PHP version: Irrelevant Package: Documentation problem Bug Type: Bug Bug description:dirname() and basename() documentation unclear/incorrect Description: ------------ The dirname() documentation, at http://www.php.net/manual/en/function.dirname.php , says that "Given a string containing a path to a file, this function will return the name of the directory.", This is either incomprehensible, or at best, ambiguous. Which directory? If giving a directory pathname, one would assume the given directory's pathname would be returned, but that is not the case. The basename() documentation is also wrong. It says the base name of the file given is returned. What's returned is not the base name, but the [POSIX] basename (without a space). Back to dirname(), it says: Returns the name of the directory. 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. This description must be copied from the coreutils dirname manpage, on which I filed a bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6175 The POSIX manpage is better, but non-free. As an alternative, I suggest to use coreutils dirname's info page. In addition to the issue in coreutils dirname's manpage, the description is not adapted to Windows. -- Edit bug report at http://bugs.php.net/bug.php?id=51830&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51830&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51830&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51830&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51830&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51830&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51830&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51830&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51830&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51830&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51830&r=support Expected behavior: http://bugs.php.net/fix.php?id=51830&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51830&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51830&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51830&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51830&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=51830&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51830&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51830&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51830&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51830&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51830&r=mysqlcfg

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