ID:               50371
 Comment by:       carsten_sttgt at gmx dot de
 Reported By:      max at kosyakov dot net
 Status:           Open
 Bug Type:         Filesystem function related
 Operating System: FreeBSD
 PHP Version:      5.2.11
 New Comment:

> %php -r '$test = "asdfasdf"; var_dump(realpath($test));

I guess
| %php -r "var_dump(realpath('/non/existent'));"
is returing false?


Previous Comments:
------------------------------------------------------------------------

[2009-12-03 12:08:42] max at kosyakov dot net

Description:
------------
realpath() returns path for the folder that does not exists. 

First appeared on php-5.2.8 on FreeBSD 6.1. I have upgraded to
php-5.2.1, however the bug persisted

%php -r '$test = "asdfasdf"; var_dump(realpath($test));
var_dump(file_exists(realpath($test)));'
string(27) "/usr/home/kosyakov/asdfasdf"
bool(false)

%php -v
PHP 5.2.11 (cli) (built: Dec  3 2009 17:26:14)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    with the ionCube PHP Loader v3.1.32, Copyright (c) 2002-2007, by
ionCube Ltd.

%uname -imprsv
FreeBSD 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May  7 04:32:43 UTC
2006     r...@opus.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
i386 GENERIC

%more /usr/soft/php-5.2.11/config.nice
#! /bin/sh
#
# Created by configure

'./configure' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-mysql=/usr/local/mysql' \
'--with-config-file-path=/usr/local/apache2/conf' \
'--with-gd' \
'--with-png-dir=/usr/local' \
'--with-jpeg-dir=/usr/local' \
'--with-freetype-dir=/usr/local' \
'--with-zlib-dir=/usr' \
'--with-iconv=/usr/local' \
'--enable-ftp' \
'--with-curl=/usr/local' \
'--with-openssl' \
'--enable-soap' \
'--with-pdo-mysql=/usr/local/mysql' \
'--with-mime-magic' \
'--enable-mbstring' \
'--without-sqlite' \
'--with-pdo-sqlite=/usr/local' \
'--enable-bcmath' \
"$@"

Bugs #43060 and #32627 look like the same bug but it is still
reproducible.

Reproduce code:
---------------
---
>From manual page: function.realpath#Description
---

$test = "asdfasdf"; 
var_dump(realpath($test)); 
var_dump(file_exists(realpath($test)));'


Expected result:
----------------
bool(false)
bool(false)


Actual result:
--------------
string(27) "/usr/home/kosyakov/asdfasdf"
bool(false)


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


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

Reply via email to