ID: 41834 User updated by: donyad at gmail dot com Reported By: donyad at gmail dot com -Status: Bogus +Status: Open Bug Type: URL related Operating System: Window2000 PHP Version: 5.2.3 New Comment:
I still think it is a bug, please reconsider. Previous Comments: ------------------------------------------------------------------------ [2007-06-28 09:21:23] donyad at gmail dot com Actually, I am parsing URL such like "www.php.net/manual/", "/opt/" just an example Even parse string "/opt/" under my Debian4.0-apache2-PHP5.2.0, this example code return the same result to me. ------------------------------------------------------------------------ [2007-06-28 08:17:15] [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 That's because "/opt/" is not a valid path on Win32. ------------------------------------------------------------------------ [2007-06-28 07:32:08] donyad at gmail dot com Description: ------------ Use pathinfo() or basename() to parse a string "/opt/" it will tell me the path is "\" and the filename is "opt" Reproduce code: --------------- <?php parsePath("/opt/"); parsePath("/opt/file"); function parsePath($str) { print("dirname:" . dirname($str) . "<br />\n"); print("basename:" . basename($str) . "<br />\n"); print("pathinfo:"); print_r(pathinfo($str)); print("<br /><br />\n"); } ?> Expected result: ---------------- dirname:/opt basename: pathinfo:Array ( [dirname] => /opt [basename] => [filename] => ) dirname:/opt basename:file pathinfo:Array ( [dirname] => /opt [basename] => file [filename] => file ) even return the "/" as "\" is acceptable dirname:\opt basename: pathinfo:Array ( [dirname] => \opt [basename] => [filename] => ) dirname:/opt basename:file pathinfo:Array ( [dirname] => /opt [basename] => file [filename] => file ) Actual result: -------------- dirname:\ basename:opt pathinfo:Array ( [dirname] => \ [basename] => opt [filename] => opt ) dirname:/opt basename:file pathinfo:Array ( [dirname] => /opt [basename] => file [filename] => file ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41834&edit=1