Skip to content

Prevent duplicate filterByTruthyValue() work in NodeScopeResolver#6103

Merged
staabm merged 1 commit into
phpstan:2.2.xfrom
staabm:prevdup
Jul 26, 2026
Merged

Prevent duplicate filterByTruthyValue() work in NodeScopeResolver#6103
staabm merged 1 commit into
phpstan:2.2.xfrom
staabm:prevdup

Conversation

@staabm

@staabm staabm commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

with polluteScopeWithAlwaysIterableForeach: true

before this PR:

➜  phpstan-src git:(2.2.x) ✗ hyperfine 'php bin/phpstan analyze src/Analyser/MutatingScope.php -v --debug' -i --runs=5
Benchmark 1: php bin/phpstan analyze src/Analyser/MutatingScope.php -v --debug
  Time (mean ± σ):      2.241 s ±  0.180 s    [User: 1.948 s, System: 0.287 s]
  Range (min … max):    2.104 s …  2.539 s    5 runs

after this PR:

➜  phpstan-src git:(2.2.x) ✗ hyperfine 'php bin/phpstan analyze src/Analyser/MutatingScope.php -v --debug' -i --runs=5
Benchmark 1: php bin/phpstan analyze src/Analyser/MutatingScope.php -v --debug
  Time (mean ± σ):      2.101 s ±  0.021 s    [User: 1.835 s, System: 0.260 s]
  Range (min … max):    2.081 s …  2.132 s    5 runs

Co-Authored-By: USAMI Kenta <tadsan@zonu.me>
@staabm

staabm commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

shipmonk/dead-code-detector breakage is unrelated, see #6098 (comment)

@staabm
staabm marked this pull request as ready for review July 26, 2026 05:21
@phpstan-bot

Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

@staabm
staabm merged commit a5a8ca4 into phpstan:2.2.x Jul 26, 2026
739 of 743 checks passed
@staabm
staabm deleted the prevdup branch July 26, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants