#28445 [Opn->Bgs]: file_exists incorrect behavior
| From: | sniper@php.net | Date: | Mon, 05 Jul 2004 23:44:39 +0000 |
| Subject: | #28445 [Opn->Bgs]: file_exists incorrect behavior | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-61733@lists.php.net to get a copy of this message | ||
ID: 28445
Updated by: sniper@php.net
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