|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-12-30 23:16 UTC] cmb@php.net
-Package: Feature/Change Request
+Package: Filesystem function related
[2021-07-19 17:44 UTC] cmb@php.net
-Status: Open
+Status: Wont fix
-Assigned To:
+Assigned To: cmb
[2021-07-19 17:44 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 10:00:01 2025 UTC |
Description: ------------ Correct me if I'm wrong, but there doesn't seem to be a single PHP-function that requires backslashes in pathnames on a Windows-box. They all work happily with forward slashes. Personally, I have stopped using backslashes altogether, but there's a single function that's always a thorn in my side: realpath(). That frequently leads to ugly work-arounds such as this: $path = str_replace('\\', '/', realpath($rawpath)); So I'd like to suggest adding an optional $directorySeparator parameter, that would default to the DIRECTORY_SEPARATOR constant: $path = realpath($rawpath, '/'); (Actually I'd prefer $directorySeparator to default to '/', but letting it default to DIRECTORY_SEPARATOR will cause no incompatibilities with anyone's existing code...) Hope that makes sense to you :0) Reproduce code: --------------- see text Expected result: ---------------- see text Actual result: -------------- see text