You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and test3.php <?php foreach (\array_fill(0, 10, "test") as $key => $content) { \unlink("test_" . $key . ".tmp"); sleep(2); }
First yuu run test1.php, this just creates 10 dummy files. Then start running test2.php and open another terminal. In that second terminal run test3.php which will remove the files 1 by 1.
test2.php will start outputting as expected, until the very last file, it will keep reporting the final is_file as true while the file is really gone ?
PHP Version
PHP 8.3.17
Operating System
Debian GNU/Linux 12 (bookworm)
The text was updated successfully, but these errors were encountered:
Sounds like a realpath cache issue, and wouldn't probably be a bug, since is_file() results are cached, but file_exists() results are not – oh, that might be Windows only (needs F_OK to be defined; not sure about POSIX systems).
Description
To reproduce this you can create these 3 files:
test1.php
<?php foreach (\array_fill(0, 10, "test") as $key => $content) { \file_put_contents("test_" . $key . ".tmp", $content); }
test2.php
<?php while(true) { foreach (\array_fill(0, 10, "test") as $key => $content) { $file = "test_" . $key . ".tmp"; echo \is_file($file) . " => " . \file_exists($file) . \PHP_EOL; } sleep(2); }
and test3.php
<?php foreach (\array_fill(0, 10, "test") as $key => $content) { \unlink("test_" . $key . ".tmp"); sleep(2); }
First yuu run test1.php, this just creates 10 dummy files. Then start running test2.php and open another terminal. In that second terminal run test3.php which will remove the files 1 by 1.
test2.php will start outputting as expected, until the very last file, it will keep reporting the final is_file as true while the file is really gone ?
PHP Version
PHP 8.3.17
Operating System
Debian GNU/Linux 12 (bookworm)
The text was updated successfully, but these errors were encountered: