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
{{ message }}
Repository navigation
Result cache is never reused on Windows with PHAR paths after 2.2.9 #15152
Full Disclosure: This report is AI generated, but represents a real problem that I have. On Windows 10, after running phpstan analyse -vv consecutively I compare the resultCache.php files and they appear exactly the same excluding lastFullAnalysisTime which is normal I think. Nevertheless, I always get - "Result cache not used because the metadata do not match: analysedPaths, executedFilesHashes" where both sections contain PHAR files.
PHPStan result cache is not reused on Windows starting with 2.2.9.
Reproduction
Environment:
Windows
PHPStan 2.2.9–2.2.12
PHPStan PHAR invoked through an absolute path
Two consecutive unchanged runs:
phpstan analyse -vv
phpstan analyse -vv
The second run reports:
Result cache will not be used.
Reason: Result cache not used because the metadata do not match: scannedFiles, executedFilesHashes
PHPStan 2.2.8 reuses the cache correctly with the same project and configuration.
The cached executedFilesHashes contains entries such as:
This appears related to the result-cache relative-path changes introduced in 2.2.9, where stream-wrapper paths are split, the filesystem part is normalized using the platform separator, and the scheme is then reattached.
For phar:// paths, the inner path should presumably continue using / even on Windows.
The regression starts exactly at:
2.2.8 -> cache reused
2.2.9 -> cache invalidated every run
Code snippet that reproduces the problem
No response
Expected output
Result cache restored. 0 files will be reanalysed.
Did PHPStan help you today? Did it make you happy in any way?
I use PHPStan all the time and it's really wonderful.
Activity
mergeable commentedon Sep 2, 2026
This bug report is missing a link to reproduction at phpstan.org/try.
It will most likely be closed after manual review.
Run the result-cache path E2E scenarios on every supported platform
Run the result cache E2E scenarios on Windows and reuse the PHAR's ca…
Run the result cache E2E scenarios on Windows and reuse the PHAR's ca…
github-actions commentedon Oct 4, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.