#45279 [WFx->Bgs]: Results of dirname() on paths ending with a /

From: Date: Wed, 05 Nov 2008 11:18:56 +0000
Subject: #45279 [WFx->Bgs]: Results of dirname() on paths ending with a /
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1362@lists.php.net to get a copy of this message
ID: 45279 Updated by: vrana@php.net Reported By: ralph at deboom dot biz -Status: Wont fix +Status: Bogus Bug Type: Documentation problem Operating System: Debian Etch 4.0+ PHP Version: 5.2.6 Previous Comments: ------------------------------------------------------------------------ [2008-11-05 11:18:45] vrana@php.net dirname() and basename() clearly states that it accepts a path to a file, not a directory. ------------------------------------------------------------------------ [2008-08-01 17:21:01] pajoye@php.net Marked as "Won't fix" from a dev point of view, move to "Documentation" ------------------------------------------------------------------------ [2008-08-01 17:17:24] ralph at deboom dot biz Then please do update the docs? ------------------------------------------------------------------------ [2008-08-01 14:42:01] dmitry@php.net The current behavior is consistent and it won't be changed, as it may break existent code. ------------------------------------------------------------------------ [2008-06-20 11:13:41] ralph at deboom dot biz ~_~ Oops, forgot the return $dirname: ------------------------- <?php function __dirname($dirname) { if (substr($dirname, -1, 1) == '/' || substr($dirname, -1, 1) == '\\') { $dirname = dirname($dirname.'.'); } else { $dirname = dirname($dirname); } return $dirname; } ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/45279 -- Edit this bug report at http://bugs.php.net/?id=45279&edit=1

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