php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18710 dirname("/") returns ("\")
Submitted: 2002-08-02 14:18 UTC Modified: 2002-10-31 18:53 UTC
From: duncan at emarketeers dot com Assigned:
Status: Closed Package: *Directory/Filesystem functions
PHP Version: 4.2.2 OS: Windows 2000
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: duncan at emarketeers dot com
New email:
PHP Version: OS:

 

 [2002-08-02 14:18 UTC] duncan at emarketeers dot com
dirname() in windows works inconsistently.

dirname("/a/b") returns "/a"

but dirname("/") returns "\"

This makes writing portable code which will work on Unix and Windows problematic.

I've looked at ext/standard/string.c and I think the fix would be to replace all occurrences of DEFAULT_SLASH with "/"

Patches

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 01:01:28 2024 UTC