This is a demo repository for PHPStan issue #13244.
- php
- curl
- dd
- bash interpreter
- ~20MB disk space
This repository contains a single empty php file for analysis, code.php. A data directory, is excluded from source control via .gitignore and from analysis by phpstan via config.neon.
Running
./test-no-data.bshwill:
- download phpstan 2.1.17,
- remove the data directory (if present), then
- clear phpstan result cache, and run phpstan twice;
- first time with no result cache, and
- second time with the result cache from the previous run.
Timings for both can be observed in the output.
Running
./test-with-data.bshwill:
- download phpstan 2.1.17,
- create and populate the data directory with 20,000 files each with 1024 bytes of random data into a directory structure several levels deep (but only if the data directory doesn't already exist), then
- clear the phpstan result cache, and run phpstan twice;
- first time with no result cache, and
- second time with the result cache from the previous run.
Timings for both can be observed in the output.
These should demonstrate that time taken by phpstan to analyse the single empty file is much slower when the excluded data directory exists, and is populated with files, than when it doesn't exist.