ID:               28445
 Updated by:       [EMAIL PROTECTED]
 Reported By:      webmaster at freshfm dot com dot au
-Status:           Open
+Status:           Bogus
 Bug Type:         Filesystem function related
 Operating System: FreeBSD 4.7-RELEASE
 PHP Version:      4.3.6
 New Comment:

See the manual page for file_exists() and the note about 'cached'..



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

[2004-05-19 14:49:18] webmaster at freshfm dot com dot au

Description:
------------
PHP4.3.6RC3 Actually. Previously reported for different versions;
#21410, #16830

Will *at seemingly random* times produce incorrect behavior.

IE:
"./images/members/admin.jpg" does not exist, but for some reason it
returns true.

Apologies if this has been corrected in later versions, I can't tell -
my ISP is evil.

Reproduce code:
---------------
function pictureExists($path, $extensions) {

    for ($i=0;$i<=count($extensions);$i++) {
                print $path . "." . $extensions[$i];
                phpinfo();
                print file_exists($path . "." . $extensions[$i]);
                print true;
        if (file_exists($path . "." . $extensions[$i]) == true) {
            return "." . $extensions[$i];
        }
    }

    return false;
}

$path = "./images/members/admin";
$exts[] = "jpg";
pictureExists($path,$exts);

Expected result:
----------------
return true


Actual result:
--------------
return false.



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


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

Reply via email to