Bug #72517 [Opn]: file_exists(), is_file() and stat() report wrong result
| From: | stgrein at gmail dot com | Date: | Wed, 29 Jun 2016 20:10:29 +0000 |
| Subject: | Bug #72517 [Opn]: file_exists(), is_file() and stat() report wrong result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-201921@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72517&edit=1
ID: 72517
User updated by: stgrein at gmail dot com
Reported by: stgrein at gmail dot com
Summary: file_exists(), is_file() and stat() report wrong
result
Status: Open
Type: Bug
Package: Filesystem function related
-Operating System:
+Operating System: Windows
PHP Version: 7.0.8
Block user comment: N
Private report: N
New Comment:
Additional information:
I used the VC14 x64 Thread Safe build from windows.php.net
Previous Comments:
------------------------------------------------------------------------
[2016-06-29 20:08:20] stgrein at gmail dot com
Description:
------------
Hi,
functions which check if a file exists do report wrong results sometimes.
I did not find a special pattern, but maybe higher load is triggering it more.
The chance on my machine is around ~1% to hit the bug per function call.
I am using PHP v7.0.8 now but also had this bug on PHP v7.0.7. I did not test with earlier Versions.
Test script:
---------------
<?php
//check an existing file
$a = file_exists("/this/file/exists");
if($a === true) {
echo "File exists!"; //expected
} else {
echo "File does NOT exists!"; //bug hit
}
//expected output:
//File exists!
//chance to get this output is around 1% on my machine under load
//File does NOT exists!
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72517&edit=1