ID: 41262 Updated by: [EMAIL PROTECTED] Reported By: tim at gerundt dot de -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: Windows PHP Version: 5.2.1 New Comment:
It uses the DEFAULT_SLASH constant which on Windows is \\ Previous Comments: ------------------------------------------------------------------------ [2007-05-02 22:18:45] tim at gerundt dot de And why is this not a bug? The dirname from (the string) "/index.php" is "/" regardless of I call the function under Windows or Linux. If I use a path string with a sub directory (like "/test/index.php") even Windows returns the correct dirname ("/test"). The problem exist only on Windows when a (unix/web) path includes no sub directories. ------------------------------------------------------------------------ [2007-05-02 20:54:01] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php ------------------------------------------------------------------------ [2007-05-02 19:34:58] tim at gerundt dot de Description: ------------ If I try to get the "dirname" from the pathinfo() function under Windows with a path like "/index.php", I get "\" instead of "/" as dirname value. Under Linux I get the desired value ("/"). I tested it with PHP 5.2.1 (Apache 2.2.4, Windows XP) and PHP 4.4.6 (Apache 2.0.54, Windows 2000). Greetings, Tim Gerundt Reproduce code: --------------- <?php $pathinfo = pathinfo('/index.php'); print_r($pathinfo); ?> Expected result: ---------------- Array ( [dirname] => / [basename] => index.php [extension] => php ) Actual result: -------------- Array ( [dirname] => \ [basename] => index.php [extension] => php ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41262&edit=1