|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20329 dirname - empty for root directory
Submitted: 2002-11-09 14:07 UTC Modified: 2002-11-09 16:32 UTC
From: ernest at vogelsinger dot at Assigned:
Status: Closed Package: Directory function related
PHP Version: 4.2.2 OS: RH Linux 7.2 (Linux 2.4.18-17.7)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ernest at vogelsinger dot at
New email:
PHP Version: OS:


 [2002-11-09 14:07 UTC] ernest at vogelsinger dot at
The documentation to dirname() states:
Note: In PHP 4.0.3, dirname() was fixed to be POSIX-compliant. Essentially, this means that 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. Note that this means that you will often get a slash or a dot back from dirname() in situations where the older functionality would have given you the empty string.
This is not true for 4.2.2, for the root directory it (still or again?) returns the empty string.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-09 16:32 UTC]
Works fine in 4.3
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu May 13 10:01:23 2021 UTC