| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2005-07-07 23:17 UTC] tony2001@php.net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 06:00:01 2025 UTC | 
Description: ------------ If you use relative path names and change the working directory then the cached data may point at the wrong file. Reproduce code: --------------- $a = file_exists('foo.txt'); chdir('bar'); $b = file_exists('foo.txt'); Expected result: ---------------- The second file_exists() call should check the file exists since it is not the same file as the original call. The stat cache should probably reference files by their absolute path names, or chdir() should clear the stat cache to ensure this doesn't happen. Actual result: -------------- If 'foo.txt' existed when checked the first time then the second file_exists() call will also return true, even if 'bar/foo.txt' doesn't exist.