From:             derek dot ethier at gmail dot com
Operating system: Windows Server 2003
PHP version:      5.2.2
PHP Bug Type:     Filesystem function related
Bug description:  realpath returns false on valid path without filename

Description:
------------
In PHP < 5.2.2 the realpath function would return a string value on a
valid path passed to the function. In 5.2.2 it returns false unless a
filename is specified.

Going over the documentation it looks like this might be an expected
result, but it is different from earlier versions.

Extensions: curl, ldap, mssql, mysql, pdo, pdo_sqlite, pdo_mssql, sqlite,
tidy, ssh2

I'm using the php.ini file from my 5.2.1 installation and going over the
incompatibilities and changes from 5.2.1 the only change that seems related
is this one:

- SplFileObject::getFilename() returns the filename, not
relative/path/to/file, as of PHP 5.2.1.

Reproduce code:
---------------
$path1 = 'E:\\webroot\\';
$path2 = 'E:\\webroot\\index.php';

var_dump(realpath($path1));
var_dump(realpath($path2));

Expected result:
----------------
string 'E:\webroot\' (length=11)
string 'E:\webroot\index.php' (length=20)

Actual result:
--------------
boolean false
string 'E:\webroot\index.php' (length=20)

-- 
Edit bug report at http://bugs.php.net/?id=41480&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41480&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41480&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41480&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41480&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41480&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41480&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41480&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41480&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41480&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41480&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41480&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41480&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41480&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41480&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41480&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41480&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41480&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41480&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41480&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41480&r=mysqlcfg

Reply via email to