Edit report at http://bugs.php.net/bug.php?id=42778&edit=1
ID: 42778
Comment by: dennis dot claassens at gmail dot com
Reported by: k dot bizuns at inbox dot lv
Summary: realpath() adds trailing slash
Status: Bogus
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Windows
PHP Version: 5.2.4
Block user comment: N
Private report: N
New Comment:
The fact that this function does not have a consistent result means that
we will have to rewrite it (in php). Wouldn't it be a lot better to make
sure the behaviour of the function (yes or no trailing slash) is a fact
instead of an unknown?
Previous Comments:
------------------------------------------------------------------------
[2010-06-11 09:31:42] php dot net at digilog dot de
Does it really make sense that this function behaves so inconsistently
about its
trailing slashes between Linux and Win?:
LINUX (tested with PHP 5.2.11):
---
realpath('.')
: string = "/myhttpdfolder"
realpath('./')
: string = "/myhttpdfolder"
realpath('fileadmin')
: string = "/myhttpdfolder/fileadmin"
realpath('fileadmin/')
: string = "/myhttpdfolder/fileadmin"
WINDOWS (tested with PHP 5.2.5):
---
realpath('.')
: string = "C:\\myhttpdfolder"
realpath('./')
: string = "C:\\myhttpdfolder\\"
realpath('fileadmin')
: string = "C:\\myhttpdfolder\\fileadmin"
realpath('fileadmin/')
: string = "C:\\myhttpdfolder\\fileadmin\\"
------------------------------------------------------------------------
[2007-10-02 09:33:23] [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-09-27 13:49:50] k dot bizuns at inbox dot lv
Description:
------------
<?php
echo realpath( './' ) ;
?>
This code in PHP 5.2.4 gives an output with trailing slash (example:
C:\www\)
PHP 5.2.3 not (example: C:\www).
Who is right? Tested on WinXP.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=42778&edit=1