Doc #64927 [Com]: realpath() still returns current path on Null/false argument

From: Date: Mon, 27 May 2013 07:48:06 +0000
Subject: Doc #64927 [Com]: realpath() still returns current path on Null/false argument
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9886@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64927&edit=1

 ID:                 64927
 Comment by:         earlchaos at gmail dot com
 Reported by:        myustc at 163 dot com
 Summary:            realpath() still returns current path on Null/false
                     argument
 Status:             Open
 Type:               Documentation Problem
 Package:            Filesystem function related
 Operating System:   Mac OS X 10.6.8
 PHP Version:        5.3.25
 Block user comment: N
 Private report:     N

 New Comment:

I don't see the problem here?

From the manual:

path

    The path being checked.

        Note:

        Whilst a path must be supplied, the value can be blank or NULL In these cases, the value is
interpreted as the current directory.


Previous Comments:
------------------------------------------------------------------------
[2013-05-27 07:42:13] myustc at 163 dot com

Description:
------------
---
From manual page: http://www.php.net/function.realpath#refsect1-function.realpath-changelog
---

I'm using PHP 5.3.15 (cli) (built: Jul 31 2012 18:42:11).
When I'm tracking a bug in Yii, I realized that it's the issue of php function realpath().
the reproducing is very easy, just run this in console:

php -r "var_dump(realpath(false), realpath(null), realpath(''));"



Test script:
---------------
<?php

var_dump(realpath(false));
var_dump(realpath(null));
var_dump(realpath(''));


Expected result:
----------------
I should see output as below:

bool(false)
bool(false)
bool(false)


Actual result:
--------------
output:(the actual path depends)

string(22) "/Users/yaowenh/phpunit"
string(22) "/Users/yaowenh/phpunit"
string(22) "/Users/yaowenh/phpunit"



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64927&edit=1


Thread (7 messages)

« previous php.doc.bugs (#9886) next »