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

From: Date: Mon, 27 May 2013 07:42:13 +0000
Subject: Doc #64927 [NEW]: realpath() still returns current path on Null/false argument
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9885@lists.php.net to get a copy of this message
From:             myustc at 163 dot com
Operating system: Mac OS X 10.6.8
PHP version:      5.3.25
Package:          Filesystem function related
Bug Type:         Documentation Problem
Bug description:realpath() still returns current path on Null/false argument

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 bug report at https://bugs.php.net/bug.php?id=64927&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=64927&r=trysnapshot54
Try a snapshot (PHP 5.3):   https://bugs.php.net/fix.php?id=64927&r=trysnapshot53
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=64927&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64927&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64927&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64927&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64927&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64927&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64927&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64927&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=64927&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=64927&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64927&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64927&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64927&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64927&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64927&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64927&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64927&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64927&r=mysqlcfg



Thread (7 messages)

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