Skip to content

Faster IsSuperTypeOfResult creation#5042

Merged
staabm merged 3 commits intophpstan:2.1.xfrom
staabm:faster-super
Feb 25, 2026
Merged

Faster IsSuperTypeOfResult creation#5042
staabm merged 3 commits intophpstan:2.1.xfrom
staabm:faster-super

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Feb 25, 2026

instead of creating IsSuperTypeOfResult without reasons and merge them later on, just merge the Trinary object and create the IsSuperTypeOfResult based on that. Effectively we create the same result with less intermediate objects involved.

triggered by Wordpress profiles, in which IsSuperTypeOfResult->and() is showing up

grafik

improvement is only a few seconds though

@phpstan-bot
Copy link
Collaborator

You've opened the pull request against the latest branch 2.2.x. PHPStan 2.2 is not going to be released for months. If your code is relevant on 2.1.x and you want it to be released sooner, please rebase your pull request and change its target to 2.1.x.

@staabm staabm changed the base branch from 2.2.x to 2.1.x February 25, 2026 11:31
@staabm staabm marked this pull request as ready for review February 25, 2026 12:55
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@staabm staabm merged commit 479ff62 into phpstan:2.1.x Feb 25, 2026
643 of 649 checks passed
@staabm staabm deleted the faster-super branch February 25, 2026 13: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