|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-09-21 21:51 UTC] pjf at asn dot pl
Description:
------------
I find caching of file_exists() and similar functions
causing strange results - as presented by attached code,
it might cause unexistent files to... "exist" :).
Reproduce code:
---------------
[pjf@boogoo file_exists]$ ls
file_exists.php
[pjf@boogoo file_exists]$ cat file_exists.php
<?php
touch("foobar");
echo file_exists("foobar") . "\n";
mkdir("foodir");
echo file_exists("foobar") . "\n";
?>
Expected result:
----------------
[pjf@boogoo file_exists]$ php file_exists.php
1
Actual result:
--------------
[pjf@boogoo file_exists]$ php file_exists.php
1
1
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 11:00:02 2025 UTC |
I made mistake in the code - here is the corrected version: touch("foobar"); echo file_exists("foobar") . "\n"; mkdir("foodir"); chdir("foodir"); echo file_exists("foobar") . "\n";