Bug #79486 [Com]: file_exists() returns true for a non-existing file

From: Date: Sat, 18 Apr 2020 06:47:54 +0000
Subject: Bug #79486 [Com]: file_exists() returns true for a non-existing file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226651@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79486&edit=1

 ID:                 79486
 Comment by:         m dot staab at complex-it dot de
 Reported by:        m dot staab at complex-it dot de
 Summary:            file_exists() returns true for a non-existing file
 Status:             Assigned
 Type:               Bug
 Package:            *General Issues
 Operating System:   windows10 x64
 PHP Version:        7.4.5
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Btw: I tried adding clearstatcache(true); right before the file_exists(), but this did not change
the result


Previous Comments:
------------------------------------------------------------------------
[2020-04-18 06:14:24] m dot staab at complex-it dot de

Not that I am aware of. 

C:\Users\mstaab\Documents\GitHub\kunzmann is a regular git checkout of a private github repo

I am wondering why its not reproducible with a 3 line script from within the same path

------------------------------------------------------------------------
[2020-04-17 17:30:56] cmb@php.net

>   ["uid"]=>
>  int(1000)
>  ["gid"]=>
>  int(1000)

Huh, that's interesting.  These values are supposed to be zero on
Windows.  Is there any reparse point (symlink, mounted volume, VFS
for Git etc.) involved in the path?

------------------------------------------------------------------------
[2020-04-17 12:28:40] m dot staab at complex-it dot de

you are right... opcache is disabled..

$ php -m
[PHP Modules]
bcmath
calendar
Core
ctype
date
dom
filter
hash
iconv
json
libxml
mysqlnd
pcre
PDO
Phar
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]




$ php -v
PHP 7.4.5 (cli) (built: Apr 14 2020 16:17:19) ( NTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

------------------------------------------------------------------------
[2020-04-17 12:21:48] sjon@php.net

if this is reproducible through the cli, you'd need opcache.enable_cli=1; did you enable that?
Did you try without enabling the opcache module?

------------------------------------------------------------------------
[2020-04-17 12:21:39] m dot staab at complex-it dot de

a few more tests

var_dump(is_readable($path . DIRECTORY_SEPARATOR . $file)); // true


var_dump(stat($path . DIRECTORY_SEPARATOR . $file));

array(26) {
  [0]=>
  int(2056)
  [1]=>
  int(19679399)
  [2]=>
  int(33204)
  [3]=>
  int(1)
  [4]=>
  int(1000)
  [5]=>
  int(1000)
  [6]=>
  int(0)
  [7]=>
  int(1)
  [8]=>
  int(1587125995)
  [9]=>
  int(1587125995)
  [10]=>
  int(1587125995)
  [11]=>
  int(-1)
  [12]=>
  int(-1)
  ["dev"]=>
  int(2056)
  ["ino"]=>
  int(19679399)
  ["mode"]=>
  int(33204)
  ["nlink"]=>
  int(1)
  ["uid"]=>
  int(1000)
  ["gid"]=>
  int(1000)
  ["rdev"]=>
  int(0)
  ["size"]=>
  int(1)
  ["atime"]=>
  int(1587125995)
  ["mtime"]=>
  int(1587125995)
  ["ctime"]=>
  int(1587125995)
  ["blksize"]=>
  int(-1)
  ["blocks"]=>
  int(-1)
}

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=79486


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


Thread (17 messages)

« previous php.bugs (#226651) next »