|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-04-03 13:33 UTC] e dot vandeoudeweetering at marcanti dot esprit-sg dot
Description:
------------
When using the function dirname, \ is returned for the root directory /
This is what the documentation says:
//after PHP 4.3.0
dirname('c:/'); // returns 'c:'
Reproduce code:
---------------
print dirname('/');
print dirname('C:/');
print dirname('C:\\'); //this function works
Expected result:
----------------
/
C:
C:\
Actual result:
--------------
\
C:\
C:\
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Jan 01 15:00:02 2026 UTC |
This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. <?php dirname('c:/x'); // returns 'c:\' dirname('c:/Temp/x'); // returns 'c:/Temp' dirname('/x'); // returns '\' ?>