diff --git a/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php b/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php index 2fb08375a1b40..d47c4053011cd 100644 --- a/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/PhpFilesAdapter.php @@ -82,7 +82,7 @@ public function prune() } if ($time >= $expiresAt) { - $pruned = $this->doUnlink($file) && !file_exists($file) && $pruned; + $pruned = ($this->doUnlink($file) || !file_exists($file)) && $pruned; } } } finally { diff --git a/src/Symfony/Component/Cache/Traits/FilesystemTrait.php b/src/Symfony/Component/Cache/Traits/FilesystemTrait.php index 38b741f1cc9c3..f2873d9efd528 100644 --- a/src/Symfony/Component/Cache/Traits/FilesystemTrait.php +++ b/src/Symfony/Component/Cache/Traits/FilesystemTrait.php @@ -40,7 +40,7 @@ public function prune() if (($expiresAt = (int) fgets($h)) && $time >= $expiresAt) { fclose($h); - $pruned = @unlink($file) && !file_exists($file) && $pruned; + $pruned = (@unlink($file) || !file_exists($file)) && $pruned; } else { fclose($h); }