Skip to content

About

Demonstration of phpstan issue 13244

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Demo of PHPStan issue #13244

This is a demo repository for PHPStan issue #13244.

Prerequisites

  • php
  • curl
  • dd
  • bash interpreter
  • ~20MB disk space

Usage

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.bsh

will:

  • 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.bsh

will:

  • 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.

About

Demonstration of phpstan issue 13244

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages